Skip to content

Instantly share code, notes, and snippets.

@nunosilva800
Created November 6, 2014 18:52
Show Gist options
  • Save nunosilva800/41eb8e645fb6e34240a2 to your computer and use it in GitHub Desktop.
Save nunosilva800/41eb8e645fb6e34240a2 to your computer and use it in GitHub Desktop.
Jquery snippet to find duplicated IDs in DOM.
$('[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