jquery: adding class on to list-items only on mouseover-remove on mouse-out?
- by user239831
hey guys,
what's the best way to do that:
i have a list
<ul>
<li>hello</li>
<li>good bye</li>
<li>arrivederci</li>
<li class="selected">dude</li>
<li>whatever</li>
</ul>
Initially one item already has a class of .selected applied. When i hover over one of the list-items i want this one to have the .selected class. So every item should only have the class applied when im over, as soon as i leave the item the class get's removed and the next one has the class.