开发者

jQuery :nth-child selecting just one?

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

There are atleast 8 li's 开发者_开发问答in there but it only selects 4th but not 8th?


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

pay attention to the 4n

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜