This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

whatToShow

Summary

The NodeIterator.whatToShow read-only property represents an unsigned integer representing a bitmask signifying what types of nodes should be returned by the NodeIterator.

Property of dom/NodeIteratordom/NodeIterator

Syntax

Note: This property is read-only.

var nodeTypes = element.whatToShow;

Return Value

Returns an object of type unsigned longunsigned long

The type of accepted nodes.p is a bitwise OR of the following values:

NodeFilter.SHOW_ALL (0xFFFFFFFF) Show all nodes.

NodeFilter.SHOW_ELEMENT (0x00000001) Show Element nodes.

NodeFilter.SHOW_ATTRIBUTE (0x00000002) show Attribute nodes.

NodeFilter.SHOW_TEXT (0x00000004) Show Text nodes.

NodeFilter.SHOW_CDATA_SECTION (0x00000008) Show CDATASection nodes.

NodeFilter.SHOW_ENTITY_REFERENCE (0x00000010) Show EntityReference nodes.

NodeFilter.SHOW_ENTITY (0x00000020) Show Entity nodes.

NodeFilter.SHOW_PROCESSING_INSTRUCTION (0x00000040) Show ProcessingInstruction nodes.

NodeFilter.SHOW_COMMENT (0x00000080) Show Comment nodes.

NodeFilter.SHOW_DOCUMENT (0x00000100) Show Document nodes.

NodeFilter.SHOW_DOCUMENT_TYPE (0x00000200) Show DocumentType nodes.

NodeFilter.SHOW_DOCUMENT_FRAGMENT (0x00000400) Show DocumentFragment nodes.

NodeFilter.SHOW_NOTATION (0x00000800) Show Notation nodes.

Examples

var nodeIterator = document.createNodeIterator(
    document.body,
    NodeFilter.SHOW_ELEMENT + NodeFilter.SHOW_COMMENT + NodeFilter.SHOW_TEXT,
    { acceptNode: function(node) { return NodeFilter.FILTER_ACCEPT; } },
    false
);
if( (nodeIterator.whatToShow == NodeFilter.SHOW_ALL)

Notes

Remarks

Filtering is based both on the whatToShow flags and the filter function.

Syntax

var nodeTypes = nodeIterator.whatToShow;

Standards information

Related specifications

DOM
Living Standard

Attributions