http://jsfiddle.net/aBaw6/2/
This demo does not add class when you hover a list item.
What am I doing wrong here?
$(\"li\").hover(
function
While others noted the missing quotation mark, I'd note that you should really be doing this with CSS instead of javascript:
http://jsfiddle.net/aBaw6/8/
li:hover{
color:green;
font-size: 20px;
}
IE6 doesn't support this on a , but you could wrap the content with an
and style that if support is needed.
If you did use javascript, you could reduce your code like this:
http://jsfiddle.net/aBaw6/7/
$("li").hover( function (e) {
$(this).toggleClass('hover', e.type === 'mouseenter');
});