Hey Everyone, Here's what i'm trying to do..
i have div that will contain numerous other div (products in a shopping cart), say up 50.
of these contained divs, i need to access every 5th div begging with 1, so it'd be div # 1, 6, 11, 16, 21 etc. and then use jQuery to Add Class to these di开发者_Python百科vs.
can someone point me in the right direction on how to do this?
it would be hugely appreciated, thanks
I think it will be useful:http://api.jquery.com/nth-child-selector/
$('div:nth-child(5n+1)).addClass('my-class');
精彩评论