function getClass( selector ){ var arr = [],content = content || document; var allEle = content.getElementsByTagName("*");//找到所有的标签 selector = selector.slice(1); for( var i = 0; i < allEle.length; i++ ){ var allClassName = allEle[i].className.split(" "); for( var j = 0; j < allClassName.length; j++ ){ if( selector === allClassName[j] ){ arr.push( allEle[i] ); break; } }; } return arr; }
var arr = [],content = content || document;
第一句就不会了???谁能每条语句都解释一下
陈士愚
相关分类