DOMTokenList

abstract external class DOMTokenList : ItemArrayLike<String> (source)

Platform and version requirements: JS

Exposes the JavaScript DOMTokenList to Kotlin

Constructors

<init>

DOMTokenList()

Exposes the JavaScript DOMTokenList to Kotlin

Properties

length

open val length: Int

value

open var value: String

Functions

add

fun add(vararg tokens: String)

contains

fun contains(token: String): Boolean

item

open fun item(index: Int): String?

remove

fun remove(vararg tokens: String)

replace

fun replace(token: String, newToken: String)

supports

fun supports(token: String): Boolean

toggle

fun toggle(
    token: String,
    force: Boolean = definedExternally
): Boolean

Extension Functions

asList

fun <T> ItemArrayLike<T>.asList(): List<T>

Returns the view of this ItemArrayLike<T> collection as List<T>

get

operator fun DOMTokenList.get(index: Int): String?