addClass every nth

try

$("ul li:nth-child(3n+1)").addClass("A")
$("ul li:nth-child(3n+2)").addClass("B")
$("ul li:nth-child(3n)").addClass("C")

Feel free to consolidate it to make it prettier, but I wanted to expose the selectors.

Leave a Comment