方法一: 複製程式碼程式碼如下: 渡//EN"> ;新文件 <BR> window.onload = function(){<BR> var Tags = document.getElementsByTagName("*"),<BR> time = new Date() ;<BR> for(var i = 0; i <count; i ){<BR> if(ret[id]){<BR> alert(id "/n使用時:" (new Date() - 時間));< ret[id] = true;<BR> <BR> }<BR> alert("未找到相同ID");<BR> }<BR> (function(){ var html = [ ], rnd = parseInt(Math.random() * 1000); { html.push("" i ""); > i = parseInt(Math.random() * 1000); html[i] = html[i] ("" 🎜> document.write(html.join("" )); })(); 方法二: 複製程式碼程式碼如下: 新文件 <BR> function createDiv(){<BR> var html = [], id;<BR> var html = [], id;<BR> var html <BR> id = "divId" parseInt(Math.random() * 10000);<BR> }<BR> document.body.innerHTML = html.join("");<BR> }<BR> window.onload = function(){<BR> window.onload = function(){<br> iv< var oID = { } , result = {}, arr = [],<br> 標籤= document.getElementsByTagName("*");<BR> id = 標籤[i].id;<BR> if(id){<BR> oID[id] 1 : 1;<BR> if(oID[id] > 1){<BR> for(var o in result){<BR> arr.push(result[o]);<BR> }<BR> 🎜> < /script><BR><BR><BODY><BR><BR>