function chkid(){
var did={},tmpid;
divs = document.getElementsByTagName("*");
for (var i=divs.length-1; i+1; i--){
(tmpid=divs[i].id)
&&did[tmpid]===undefined
?did[tmpid]=0
:did[tmpid]++;
}
for (var i in did) {
did[i]&&alert("id="+i+"重复了"+(did[i]+1)+"次");
}
}
posted on 2009-03-02 20:40
汪杰 阅读(184)
评论(0) 编辑 收藏 引用 所属分类:
javascript