Skip to content

Instantly share code, notes, and snippets.

@martynchamberlin
Last active December 20, 2015 08:39
Show Gist options
  • Save martynchamberlin/6101949 to your computer and use it in GitHub Desktop.
Save martynchamberlin/6101949 to your computer and use it in GitHub Desktop.
Super easy way to give similar items a unique DOM identifier using jQuery
jQuery(document).ready(function( $ )
{
var i = 1;
$('nav li').each(function()
{
$(this).addClass('item_' + i );
i++;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment