1 function getClass(obj,aClass){ 2 var oParent = obj.getElementsByTagName('*'); 3 var result = []; 4 for(var i=0;i<oParent.length;i++){ 5 var aClassName = oParent[i].className.split(' '); 6 for(var j=0;j<aClassName.length;j++){ 7 if(aClassName[j] == aClass){ 8 result.push(oParent[i]); 9 } 10 } 11 } 12 return result; 13 }