function getElementsByClassName(node,classname){
if(node.getElementsByClassName){
return node.getElementsByClassName(classname);
}else{
var results=new Array();
var elems=node.getElementsByTagName("*");
for(var i=0;i<elems.length;i++){
if(elems[i].classname.indexof(classname)!=-1){
results[results.length]=elems[i];
};
};
return results;
}
}
时间: 2024-10-17 16:25:48