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 override val length: Int

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

Functions

Link copied to clipboard
Link copied to clipboard
open fun forEach(action: (item: T) -> Unit)
Link copied to clipboard
open operator fun get(index: Int): T
Link copied to clipboard
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 fun keys(): JsIterator<JsInt>
Link copied to clipboard
open fun values(): JsIterator<T>