标签:
function getElementsByClassName(n) {
var classElements = []
allElements = document.getElementsByTagName("*");
for (var i = 0; i < allElements.length; i++) {
if (allElements[i].className == n) {
classElements[classElements.length] = allElements[i];
}
}
return classElements;
}
标签:
原文地址:http://www.cnblogs.com/WarBlog/p/5101864.html