摘要:
JS获取class的方法一:普通版:<script type="text/javascript">function getByClass(oParent, sClass){var aEle=oParent.getElementsByTagName('*');var aResult=[];var i=0;for(i=0;i<aEle.length;i++){if(aEle[i].className==sClass){aResult.push(aEle[i]);}}return aResult;}</script>JS获取class 阅读全文