function getElementsByClassName(elem_name,elem_tags) { //elem_name: Query class Name, elem_tags: under which element to search
if(elem_tags == null) {
elem_tags = '*';
}
var all_elem = document.getElementsByTagName(elem_tags);//Return one Element array
var arr = []; //Define an empty array to store the result
for(var i=0; i
if(all_elem[i].className == elem_name) {
arr.push(all_elem[i]);
}
}
return arr; //Return this result array
}