Add a class with Javascript

sszs

New Member
When a particular page loads, these are the state of the \[code\]<li>\[/code\] elements:\[code\]<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>\[/code\]At any point, there is only one \[code\]<li>\[/code\] having the \[code\]left: 0px; top: 0px\[/code\]. I want to add a class (say, \[code\].dummy\[/code\] ) to the \[code\]<li>\[/code\] element that has this property using javascript.I'm a newbie in Javascript. I tried add ign this:\[code\]$("li").addClass("dummy");\[/code\]But I couldn't figure out the required \[code\]if\[/code\] statement.
 
Back
Top