Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface NodeList

Package version

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

Hierarchy

Indexable

[index: number]: Node

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

Index

Properties

Methods

Properties

length

length: number

Returns the number of nodes in the collection.

Methods

forEach

  • forEach(callbackfn: (value: Node, key: number, parent: NodeList) => void, thisArg?: any): void
  • Performs the specified action for each node in an list.

    Parameters

    • callbackfn: (value: Node, key: number, parent: NodeList) => void

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

    • Optional thisArg: any

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

    Returns void

item

  • item(index: number): Node | null
  • Returns the node with index index from the collection. The nodes are sorted in tree order.

    Parameters

    • index: number

    Returns Node | null

Generated using TypeDoc