Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

NodeList

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

interface NodeList {
[index: number]: Node;
readonly length: number;
[[Symbol.iterator]](): IterableIterator<Node>;
entries(): IterableIterator<[number, Node]>;
forEach(callbackfn: (
value: Node,
key: number,
parent: NodeList,
) => void
, thisArg?: any): void;
item(index: number): Node | null;
keys(): IterableIterator<number>;
values(): IterableIterator<Node>;
}
var NodeList: {
prototype: NodeList;
new (): NodeList;
}
;

§Index Signatures

§
[index: number]: Node

§Properties

§
readonly length: number
[src]

Returns the number of nodes in the collection.

§Methods

§
[[Symbol.iterator]](): IterableIterator<Node>
[src]
§
entries(): IterableIterator<[number, Node]>
[src]

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

§
forEach(callbackfn: (
value: Node,
key: number,
parent: NodeList,
) => void
, thisArg?: any): void
[src]

Performs the specified action for each node in an list.

@param callbackfn

A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.

@param thisArg

An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

§
item(index: number): Node | null
[src]

Returns the node with index index from the collection. The nodes are sorted in tree order.

§
keys(): IterableIterator<number>
[src]

Returns an list of keys in the list.

§
values(): IterableIterator<Node>
[src]

Returns an list of values in the list.