http://www.fgm.cc/learn/lesson8/01.html上面是源码上面这段js代码中的var get = { byId: function(id) { return typeof id === "string" ? document.getElementById(id) : id }, byClass: function(sClass, oParent) { var aClass = []; var reClass = new RegExp("(^| )" + sClass + "( |$)"); var aElem = this.byTagName("*", oParent); for (var i = 0; i < aElem.length; i++) reClass.test(aElem[i].className) && aClass.push(aElem[i]); return aClass }, byTagName: function(elem, obj) { return (obj || document).getElementsByTagName(elem) }这一段怎么解释呢?请帮我解释一下,谢谢。
添加回答
举报
0/150
提交
取消