This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 判断每个dom节点是否拥有子元素, 若有则返回该节点 | |
function isChild(node){ | |
if(node.childNodes.length == 0){ | |
return false; | |
} | |
else { | |
return node; | |
} | |
} |