Can’t seem to get this to work:
$(function() {
$("#side").$("li").each(function() {
$(this).mouseover(function() {
$(this).backgroundColor = "#c0c0c0";
});
});
});
The HTML snippet to iterate over:
<div id='side'>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
Try this instead:
The issues I saw were:
The JSFiddle: http://jsfiddle.net/L8hsz/
Hope that helps.
EDIT: If you’re worried about the background color, you can do something similar to: