jQuery — Selectors: Select Every Nth Item

To select every nth item, use the child selector “nth-child()”

To select every 5th child, use 5n
$("#mylist li:nth-child(5n)").stuff()

Type in a whole number to get the nth item only.

Leave a Comment