Skip to content

Instantly share code, notes, and snippets.

@jasonglisson
Last active September 14, 2017 12:39
Show Gist options
  • Save jasonglisson/112194842c70fe7da174 to your computer and use it in GitHub Desktop.
Save jasonglisson/112194842c70fe7da174 to your computer and use it in GitHub Desktop.
Javascript - Show duplicate IDs in console
-// Warning Duplicate IDs
-$('[id]').each(function(){
- var ids = $('[id="'+this.id+'"]');
- if(ids.length>1 && ids[0]==this)
- console.warn('Multiple IDs #'+this.id);
-});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment