时间:2021-07-01 10:21:17 帮助过:2人阅读
<script type="text/javascript">
function getElementsByClassName(classname,node){
node = node || window.document;
if(node.getElementsByClassName){
return node.getElementsByClassName(classname);
}else{
var results = new Array();
var elems = node.getElementsByTag("*");
for (var i=0;i<elems.length;i++){
if(elems[i].className.indexOf(classname) != -1){
results[elems.length] = elems[i];
}
}
return results;
}
};
</script>