NodeList

open class NodeList<out T : Node> : ListLike.Mixin<T> (source)

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

MDN Reference

Inheritors

Properties

Link copied to clipboard
open external override val length: Int

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

Functions

Link copied to clipboard
open external fun entries(): JsIterator<Tuple2<JsInt, T>>
Link copied to clipboard
open external fun forEach(action: (item: T) -> Unit)
Link copied to clipboard
open operator external fun get(index: Int): T
Link copied to clipboard
external fun item(index: Int): T?

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.

Link copied to clipboard
open external fun keys(): JsIterator<JsInt>
Link copied to clipboard
open external fun values(): JsIterator<T>