nth-child jquery


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $("ul li:nth-child(3n+1)").addClass("A")
  2. $("ul li:nth-child(3n+2)").addClass("B")
  3. $("ul li:nth-child(3n)").addClass("C")

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.