标签:rip node def java asc 遍历 log tno var
var iterator = document.createNodeIterator(document.body, NodeFilter.SHOW_ELEMENT, null, false) var node = iterator.nextNode() while (node !== null) { console.log(node.tagName) node = iterator.nextNode() }
或:
var iterator = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT, null, false) var node = iterator.firstChild() while (node !== null) { console.log(node.tagName) node = iterator.nextSibling() }
标签:rip node def java asc 遍历 log tno var
原文地址:https://www.cnblogs.com/hanxiaoer/p/11552461.html