I have a simple unordered list with 16 list items. I want to add a new list item after every fourth existing list item using jQuery
How would I do that? Code below:<
Using the :nth-child selector (documentation):
:nth-child
$('ul li:nth-child(4n)').after('<li class="clear">This is what I want to add</li>')