Skip to content

Instantly share code, notes, and snippets.

@felipem775
Last active August 29, 2015 14:16
Show Gist options
  • Save felipem775/8df28affaff488846446 to your computer and use it in GitHub Desktop.
Save felipem775/8df28affaff488846446 to your computer and use it in GitHub Desktop.
ids repetidos
// Basado en http://stackoverflow.com/questions/482763/jquery-to-check-for-duplicate-ids-in-a-dom
$('[id]').each(function(){
var ids = $('[id="'+this.id+'"]');
if(ids.length>1 && ids[0]==this)
console.warn('IDs con repeticiones: ' + this.id + ', veces:' + ids.length);
});
@VictorVelarde
Copy link

está práctico esto, sí.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment