Trying to get the previous class of an elements using JavaScript.
<li class="dynamic_class second_dynamic_class xx "></li>
<li class="dynamic_class second_dynamic_class"></li>
I want to put into a var and compare the dymanic_class of the <li> with the class="xx".
ONLY pure JavaScript allowed !
Further Details:
<li class='day_1 24.02.2013' data-name='day_1 24.02.2013' >
more code
</li>
<li class='day_2 25.02.2013 today' data-name='day_2 25.02.2013' >
more code
</li>
<li class='day_3 26.02.2013' data-name='day_3 26.02.2013' >
more code
</li>
<li class='day_4 27.02.2013' data-name='day_4 27.02.2013' ></li>
First I need to select the < li> with the class today than read the "previous" < li> class of the same element, i need to obtain the class="day_1" into a var.