public
Created

Detect Duplicated #ID Names and Warn

  • Download Gist
detect_duplicate_ids.js
JavaScript
1 2 3 4 5
$('[id]').each(function(){
var ids = $('[id='+this.id+']');
if(ids.length>1 && ids[0]==this)
console.warn('Multiple IDs #'+this.id);
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.