function getElementsByClassName(elem_name,elem_names.name,elem.名,elem_tags:在哪個元素下查找
if(elem_tags == null) {
elem_tags = '*';
}
var all_elem = document.getElementsByTagName(elem_tags);////_tags元素數組
var arr = []; //定義一個空數組,用於存放結果
for(var i=0; i
if(all_elem[i].className == elem_name) {
arr.push(all_elem[i]);
}
}
return arr; //回傳這個結果陣列
}