getByClass()
1 function getByClass(clsName, parent){ 2 var oParent=parent?document.getElementById(parent):document, 3 boxArr=new Array(), 4 oElements=oParent.getElementsByTagName('*'); 5 for(var i=0;i<oElements.length;i++){ 6 if(oElements[i].className==clsName){ 7 boxArr.push(oElements[i]); 8 } 9 } 10 return boxArr;