gistfile1.txt var getChildNodes = function(ele){ var childArr = ele.children || ele.childNodes; //兼容更多的浏览器 var childArrTem = new Array(); // 临时数组,用来存储符合条件的节点 for(var i = 0; i childArr.length;
var getChildNodes = function(ele){ var childArr = ele.children || ele.childNodes; //兼容更多的浏览器 var childArrTem = new Array(); // 临时数组,用来存储符合条件的节点 for(var i = 0; i < childArr.length; i++){ if(childArr[i].nodeType == 1){ childArrTem.push(childArr[i]); } } return childArrTem; }