package js.html
Available on js
The DOMTokenList interface represents a set of space-separated tokens. Such a set is returned by Element.classList, HTMLLinkElement.relList, HTMLAnchorElement.relList, HTMLAreaElement.relList, HTMLIframeElement.sandbox, or HTMLOutputElement.htmlFor. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive.
Documentation DOMTokenList by Mozilla Contributors, licensed under CC-BY-SA 2.5.
See also:
read onlylength:IntIs an integer representing the number of objects stored in the object.
value:StringThe value of the list as a DOMString.
add(tokens:Rest<String>):VoidAdds the given token to the list.
Throws:
null |
DOMError |
|---|
contains(token:String):BoolReturns true if the list contains the given token, otherwise false.
item(index:Int):StringReturns an item in the list by its index (returns undefined if the number is greater than or equal to the length of the list).
remove(tokens:Rest<String>):VoidRemoves the specified token from the list.
Throws:
null |
DOMError |
|---|
replace(token:String, newToken:String):BoolReplaces an existing token with a new token.
Throws:
null |
DOMError |
|---|
supports(token:String):BoolReturns true if a given token is in the associated attribute's supported tokens.
Throws:
null |
DOMError |
|---|
toggle(token:String, ?force:Bool):BoolRemoves a given token from the list and returns false. If token doesn't exist it's added and the function returns true.
Throws:
null |
DOMError |
|---|
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/DOMTokenList.html