When a particular page loads, these are the state of the <li> elements:
<li class="li1 frame3" style="display: list-item; opacity: 0.3; left: 0px; top: 20px; z-index: 2;"></li>
<li class="li2 frame4" style="display: list-item; opacity: 0.3; left: 151px; top: 0px; z-index: 2;"></li>
<li class="li3 frame5" style="display: list-item; opacity: 0.3; left: 0px; top: 0px; z-index: 2;"></li>
At any point, there is only one <li> having the left: 0px; top: 0px. I want to add a class (say, .dummy ) to the <li> element that has this property using javascript.
I'm a newbie in Javascript. I tried add ign this:
$("li").addClass("dummy");
But I couldn't figure out the required if statement.
<li>elements and compareelement.style.leftandelement.style.top. I am afraid there is no easier way to do itifstatement"? If you want to add a class to an element, then add a class to an element.<li>element is found to have the propertyleft:0px; top:0pxapply theaddClassto that<li>element only. I was unable to figure out that condition; how to check for the inline style.