I need to add a class to every other li element. I would typically use the nth-child(odd) selector but I need this to work in IE7. What is the best way to add the class to every other element?
I need to add a class to every other li element. I would typically
Share
$('li:even').addClass('whatever');http://api.jquery.com/even-selector/