Last active
December 20, 2015 08:39
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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