找到下一个“元素节点”通用函数
//下一个元素节点通用函数 function getNextElement(node){ if(node.nodeType == 1){ return node; } //元素下一个节点,继续执行本次函数,循环,一直到找到下一个元素节点为止,则退出本次循环 if(node.nextSibling){ return getNextElement(node.nextSibling); } return null; }
//下一个元素节点通用函数 function getNextElement(node){ if(node.nodeType == 1){ return node; } //元素下一个节点,继续执行本次函数,循环,一直到找到下一个元素节点为止,则退出本次循环 if(node.nextSibling){ return getNextElement(node.nextSibling); } return null; }