Skip to content

Instantly share code, notes, and snippets.

@mrbusche
Created June 2, 2014 14:19
Show Gist options
  • Save mrbusche/e6f3b93a51715654edaf to your computer and use it in GitHub Desktop.
Save mrbusche/e6f3b93a51715654edaf to your computer and use it in GitHub Desktop.
Bookmarklet to check for duplicate IDs
javascript:(function () { var ids = {}; var found = false; $('[id]').each(function() { if (this.id && ids[this.id]) { found = true; console.warn('Duplicate ID #'+this.id); } ids[this.id] = 1; }); if (!found) console.log('No duplicate IDs found'); })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment