Created
June 16, 2016 19:53
-
-
Save jp26jp/f969fadafa8fa695a46c30a7e7dc6052 to your computer and use it in GitHub Desktop.
Incrementally add a new ID to each selector
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
var i = 0; | |
$('.class').each(function() { | |
i++; | |
var newID = 'section'+i; | |
$(this).attr('id',newID); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment