Created
November 6, 2014 18:52
-
-
Save nunosilva800/41eb8e645fb6e34240a2 to your computer and use it in GitHub Desktop.
Jquery snippet to find duplicated IDs in DOM.
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
$('[id]').each(function(){ | |
var ids = $('[id="'+this.id+'"]'); | |
if(ids.length>1 && ids[0]==this) | |
console.warn('ID #'+this.id+' found '+ids.length+' times'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see http://stackoverflow.com/questions/482763/jquery-to-check-for-duplicate-ids-in-a-dom