Last active
August 29, 2015 14:14
-
-
Save nhducit/60449650f1a3ae3b8973 to your computer and use it in GitHub Desktop.
Javascript snippet to check duplicated ID in html page
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
Select all below snippet => drag and drop in browser bookmark bar | |
=> click on bookmark which you have just add => check the browser console | |
javascript:(function(){var e={};$("[id]").each(function(){var t=$('[id="'+this.id+'"]');if(t.length>1&&t[0]===this){e.id=this.id;e.obj=this;e.obj2=t[0]}});console.warn("Duplicate ID:",e.id,e.obj,e.obj2)})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment