Represents an underlying string that consists of a set of space-separated tokens.
Platform Support
| Mozilla | Chrome | Safari | Opera | IE | Netscape | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|---|
Constructors
| Constructor | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | ||
|---|---|---|---|---|---|---|---|---|---|
|
DOMSettableTokenList Constructor() : DOMSettableTokenList
Creates an instance of the DOMSettableTokenList.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | ||
DOMSettableTokenList() : DOMSettableTokenListCreates an instance of the DOMSettableTokenList. Returns
|
|||||||||
Inherited Properties
| Property | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape |
|---|---|---|---|---|---|---|---|
|
length
: Number
Returns the number of tokens in the string.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
Properties
| Property | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape |
|---|---|---|---|---|---|---|---|
|
value
: Boolean
Returns the underlying string on getting, and must replace the underlying string with the new value on setting.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ |
|
|||||||
Inherited Functions
| Method | Action | Mozilla | Chrome | Safari | Opera | IE | Netscape | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
item(String index) : String
Returns the token with specified index. The tokens are returned in the order they are found in the underlying string.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||||
|
Parameters
Returns
|
||||||||||||
|
contains(String token) : Boolean
Returns true if the token is present; false otherwise.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||||
|
Parameters
Returns
|
||||||||||||
|
add(String token) :
void
Adds token, unless it is already present.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||||
|
Parameters
|
||||||||||||
|
remove(String token) :
void
Removes token if it is present.
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||||
|
Parameters
|
||||||||||||
|
toggle(String token) : Boolean
Adds token if it is not present, or removes it if it is. Returns true if token is now present (it was added); returns false
if it is not (it was removed).
|
Show Details | 1.0+ | 5.0+ | 1.0+ | 5.0+ | 4.0+ | 6.0+ | |||||
|
Parameters
Returns
|
||||||||||||
References
Availability
JavaScript 1.2|WhatWG