完整版getByClass2016/4/20
function getByclass(parent,sclass) { var re=new RegExp('\\b'+sclass+'\\b','i') var aEli=parent.getElementsByTagName('*'); var arr=[]; for(var i=0;i<aEli.length;i++) { if(re.test(aEli[i].className)) { arr.push(aEli[i]); } } return arr; }