Skip to main content

NodeListOf

NodeList objects are collections of nodes, usually returned by properties such as Node.childNodes and methods such as document.querySelectorAll().

MDN Reference

Extends

Extended by

Type Parameters

Type Parameter
TNode extends Node

Indexable

[index: number]: TNode

Methods

[iterator]()

iterator: ArrayIterator<TNode>;

Returns

ArrayIterator<TNode>

Inherited from

NodeList.[iterator]


entries()

entries(): ArrayIterator<[number, TNode]>;

Returns an array of key, value pairs for every entry in the list.

Returns

ArrayIterator<[number, TNode]>

Inherited from

NodeList.entries


forEach()

forEach(callbackfn, thisArg?): void;

Parameters

ParameterType
callbackfn(value, key, parent) => void
thisArg?any

Returns

void

Overrides

NodeList.forEach


item()

item(index): TNode;

Returns a node from a NodeList by index. This method doesn't throw exceptions as long as you provide arguments. A value of null is returned if the index is out of range, and a TypeError is thrown if no argument is provided.

MDN Reference

Parameters

ParameterType
indexnumber

Returns

TNode

Overrides

NodeList.item


keys()

keys(): ArrayIterator<number>;

Returns an list of keys in the list.

Returns

ArrayIterator<number>

Inherited from

NodeList.keys


values()

values(): ArrayIterator<TNode>;

Returns an list of values in the list.

Returns

ArrayIterator<TNode>

Inherited from

NodeList.values

Properties

length

readonly length: number;

The NodeList.length property returns the number of items in a NodeList.

MDN Reference

Inherited from

NodeList.length