1 function getByClass(oParent, sClass) 2 { 3 var aEle=oParent.getElementsByTagName('*'); 4 var aResult=[]; 5 var i=0; 6 7 for(i=0;i<aEle.length;i++) 8 { 9 if(aEle[i].className==sClass) 10 { 11 aResult.push(aEle[i]); 12 } 13 } 14 15 return aResult; 16 }