Last active
September 14, 2017 12:39
-
-
Save jasonglisson/112194842c70fe7da174 to your computer and use it in GitHub Desktop.
Javascript - Show duplicate IDs in console
This file contains hidden or 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
-// 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