browser_duplicateIDs.js (236B)
1 function test() { 2 var ids = {}; 3 Array.prototype.forEach.call( 4 document.querySelectorAll("[id]"), 5 function (node) { 6 var id = node.id; 7 ok(!(id in ids), id + " should be unique"); 8 ids[id] = null; 9 } 10 ); 11 }