| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/API/NodeIterator/whatToShow | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since July 2015.
The NodeIterator.whatToShow read-only property represents
an unsigned integer representing a bitmask signifying what types of nodes
should be returned by the NodeIterator.
A non-negative integer. For the list of possible values, see document.createNodeIterator().
const nodeIterator = document.createNodeIterator(
document.body,
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT,
{ acceptNode: (node) => NodeFilter.FILTER_ACCEPT },
);
if (
nodeIterator.whatToShow & NodeFilter.SHOW_ALL ||
nodeIterator.whatToShow & NodeFilter.SHOW_COMMENT
) {
// nodeIterator will show comments
}
| Specification |
|---|
| DOM # dom-nodeiterator-whattoshow |
NodeIterator.This page was last modified on Oct 23, 2025 by MDN contributors.
NodeIteratorAbortControllerAbortSignalAbstractRangeAttrCDATASectionCharacterDataCommentCustomEventDOMErrorDOMExceptionDOMImplementationDOMParserDOMTokenListDocumentDocumentFragmentDocumentTypeElementEventEventTargetHTMLCollectionMutationObserverMutationRecordNamedNodeMapNodeNodeListProcessingInstructionQuotaExceededErrorRangeShadowRootStaticRangeTextTreeWalkerXMLDocumentXPathEvaluatorXPathExpressionXPathResultXSLTProcessorYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |