1.14.0.5
Hummingbird
A modern user interface library for games
DOMTokenList Interface Reference

The DOMTokenList of the element. Currently it is only supported in the context of class list. More...

Public Member Functions

getter DOMString item (unsigned long index)
 getter for a token from the list More...
 
boolean contains (DOMString token)
 checks whether the list contains token More...
 
void add (DOMString tokens)
 adds tokens to the list More...
 
void remove (DOMString tokens)
 removes tokens from the list More...
 
boolean toggle (DOMString token, optional MaybeBool force)
 toggles a token from the list More...
 
void replace (DOMString token, DOMString newToken)
 replaces token with newToken More...
 
boolean supports (DOMString token)
 not imlemented for class list
 

Public Attributes

readonly attribute unsigned long length
 length of the list
 
stringifier attribute DOMString value
 string with all tokens space separated
 

Detailed Description

The DOMTokenList of the element. Currently it is only supported in the context of class list.

Member Function Documentation

◆ add()

void DOMTokenList::add ( DOMString  tokens)

adds tokens to the list

Parameters
tokensto be added (currently only single token can be added)

◆ contains()

boolean DOMTokenList::contains ( DOMString  token)

checks whether the list contains token

Parameters
token
Returns
true if the token is in the list false otherwise

◆ item()

getter DOMString DOMTokenList::item ( unsigned long  index)

getter for a token from the list

Parameters
indexof the token in the list
Returns
string of the token name at position index or empty token if the index is out of range

◆ remove()

void DOMTokenList::remove ( DOMString  tokens)

removes tokens from the list

Parameters
tokensto be removed (currently only single token can be removed)

◆ replace()

void DOMTokenList::replace ( DOMString  token,
DOMString  newToken 
)

replaces token with newToken

Parameters
tokento be replaced
newTokenthe token to replace token with

◆ toggle()

boolean DOMTokenList::toggle ( DOMString  token,
optional MaybeBool  force 
)

toggles a token from the list

Parameters
tokento be toggled
forceif true adds token otherwise removes token
Returns
true if the token was added otherwise false