How can I also add class to the last list for the second list block in IE?
Posted
by user244394
on Stack Overflow
See other posts from Stack Overflow
or by user244394
Published on 2010-03-08T04:16:50Z
Indexed on
2010/03/08
4:21 UTC
Read the original article
Hit count: 251
jQuery
Hi All I have 2 list and i want to add a class ="last" to the list item 5 for both. they seem to work fine on firefox. it add green to both list item 5.
But in IE7 it adds only the first list item 5, not the second
How can I also add class last it to the second list block as well for IE?
.last{background-color: green}
jQuery( document ).ready( function () { // Add first and last menu item classes $('ul.menu li:first-child').addClass( 'first_item' ); $('#menu > li:last-child').addClass( 'last' ); });© Stack Overflow or respective owner