| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/zh-CN/docs/Web/API/NodeIterator | [Back] [Original] |
Get to know MDN better
NodeIterator DOM
NodeIterator Document.createNodeIterator()
var nodeIterator = document.createNodeIterator(root, whatToShow, filter);
NodeIterator.root Node NodeIterator
NodeIterator.whatToShow | Constant | Numerical value | Description |
|---|---|---|
NodeFilter.SHOW_ALL |
-1 (that is the max value of unsigned long) |
|
NodeFilter.SHOW_ATTRIBUTE |
2 |
Attr Attr NodeIterator ; |
NodeFilter.SHOW_CDATA_SECTION |
8 |
CDATASection |
NodeFilter.SHOW_COMMENT |
128 |
Comment |
NodeFilter.SHOW_DOCUMENT |
256 |
Document |
NodeFilter.SHOW_DOCUMENT_FRAGMENT |
1024 |
DocumentFragment |
NodeFilter.SHOW_DOCUMENT_TYPE |
512 |
DocumentType |
NodeFilter.SHOW_ELEMENT |
1 |
Element |
NodeFilter.SHOW_ENTITY |
32 |
Entity Entity NodeIterator ; Entity Entity |
NodeFilter.SHOW_ENTITY_REFERENCE |
16 |
EntityReference |
NodeFilter.SHOW_NOTATION |
2048 |
Notation Notation NodeIterator ; Notation Notation |
NodeFilter.SHOW_PROCESSING_INSTRUCTION |
64 |
ProcessingInstruction |
NodeFilter.SHOW_TEXT |
4 |
Text |
NodeIterator.filter NodeIterator.expandEntityReferences Is a Boolean indicating if, when discarding an EntityReference its whole sub-tree must be discarded at the same time.
NodeIterator.referenceNode Node .
NodeIterator.pointerBeforeReferenceNode Returns a Boolean flag that indicates whether the NodeIterator is anchored before, the flag being true, or after, the flag being false, the anchor node.
NodeIterator.detach() NodeIterator
NodeIterator.previousNode() Node null.
NodeIterator.nextNode() Node, null .
| DOM # interface-nodeiterator |
Document.createNodeIterator().NodeFilter, TreeWalker.NodeIteratorAbortControllerAbortSignalAbstractRangeAttrCDATASectionCharacterDataCommentCustomEventDOMErrorDOMExceptionDOMImplementationDOMParserDOMTokenListDocumentDocumentFragmentDocumentTypeElementEventEventTargetHTMLCollectionMutationObserverMutationRecordNamedNodeMapNodeNodeListProcessingInstructionQuotaExceededErrorRangeShadowRootStaticRangeTextTreeWalkerXMLDocumentXPathEvaluatorXPathExpressionXPathResultXSLTProcessor| Web Proxy Viewer | New URL | Original Page |