The DOMTokenList of the element. Currently it is only supported in the context of class list.
More...
|
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
|
|
|
readonly attribute unsigned long | length |
| length of the list
|
|
stringifier attribute DOMString | value |
| string with all tokens space separated
|
|
The DOMTokenList of the element. Currently it is only supported in the context of class list.
◆ add()
void DOMTokenList::add |
( |
DOMString |
tokens | ) |
|
adds tokens to the list
- Parameters
-
tokens | to be added (currently only single token can be added) |
◆ contains()
boolean DOMTokenList::contains |
( |
DOMString |
token | ) |
|
checks whether the list contains token
- Parameters
-
- 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
-
index | of 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
-
tokens | to be removed (currently only single token can be removed) |
◆ replace()
void DOMTokenList::replace |
( |
DOMString |
token, |
|
|
DOMString |
newToken |
|
) |
| |
replaces token with newToken
- Parameters
-
token | to be replaced |
newToken | the token to replace token with |
◆ toggle()
boolean DOMTokenList::toggle |
( |
DOMString |
token, |
|
|
optional MaybeBool |
force |
|
) |
| |
toggles a token from the list
- Parameters
-
token | to be toggled |
force | if true adds token otherwise removes token |
- Returns
- true if the token was added otherwise false