Skip to content

Instantly share code, notes, and snippets.

@GLMeece
Created January 12, 2017 16:58
Show Gist options
  • Save GLMeece/1521d6ab6e0a5026233b8f77c38dcb96 to your computer and use it in GitHub Desktop.
Save GLMeece/1521d6ab6e0a5026233b8f77c38dcb96 to your computer and use it in GitHub Desktop.
Find Duplicate IDs on a Web Page
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