DOMTokenList

open class DOMTokenList<T : JsAny> : ListLike<T> (source)

The DOMTokenList interface represents a set of space-separated tokens.

MDN Reference

Properties

Link copied to clipboard
open override val length: Int

The read-only length property of the DOMTokenList interface is an integer representing the number of objects stored in the object.

Link copied to clipboard
var value: T

The value property of the DOMTokenList interface is a stringifier that returns the value of the list serialized as a string, or clears and sets the list to the given value.

Functions

Link copied to clipboard
fun add(vararg tokens: T)

The add() method of the DOMTokenList interface adds the given tokens to the list, omitting any that are already present.

Link copied to clipboard
fun contains(token: T): Boolean

The contains() method of the DOMTokenList interface returns a boolean value — true if the underlying list contains the given token, otherwise false.

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

The item() method of the DOMTokenList interface returns an item in the list, determined by its position in the list, its index.

Link copied to clipboard
open override fun keys(): JsIterator<JsInt>
Link copied to clipboard
fun remove(vararg tokens: T)

The remove() method of the DOMTokenList interface removes the specified tokens from the list.

Link copied to clipboard
fun replace(token: T, newToken: T): Boolean

The replace() method of the DOMTokenList interface replaces an existing token with a new token.

Link copied to clipboard
fun supports(token: T): Boolean

The supports() method of the DOMTokenList interface returns true if a given token is in the associated attribute's supported tokens.

Link copied to clipboard
fun toggle(token: T, force: Boolean = definedExternally): Boolean

The toggle() method of the DOMTokenList interface removes an existing token from the list and returns false.

Link copied to clipboard
open override fun values(): JsIterator<T>