var allTags = document.body.getElementsByTagName('*');
var ids = {};
var doubledIds = [];
for (var tg = 0; tg< allTags.length; tg++) {
var tag = allTags[tg];
if (tag.id) {
if (! ids[tag.id]) {
ids[tag.id] = true;
} else {
doubledIds.push(tag.id);
}
}
}
alert('doubled ids: ' + doubledIds);
Find doubled IDs in the DOM
Leave a Reply
You must be logged in to post a comment.