views:

49

answers:

1
$('.mydiv ul li:nth-child(4)').addClass("nth");

There are atleast 8 li's in there but it only selects 4th but not 8th?

+5  A: 
$('.mydiv ul li:nth-child(4n)').addClass("nth");

pay attention to the 4n

Brandon H
AAAH! Thanks :)
Nimbuz