HTML DOMTokenList value Property
- Previous Page toggle()
- Next Page values()
- Go to Parent Directory HTML DOMTokenList
Definition and Usage
The value property returns DOMTokenList as a string.
Example
Example 1
Get the element's classList as a string:
const list = element.classList; let text = list.value;
Example 2
Add the "myStyle" class to the element:
const list = element.classList; list.add("myStyle");
Example 3
Remove the "myStyle" class from the element:
const list = element.classList; list.remove("myStyle");
Syntax
domtokenlist.value
Parameter
No Parameters
Return Value
Type | Description |
---|---|
String | String Representation of DOMTokenList |
Browser Support
domtokenlist.value is a DOM Level 4 (2015) feature.
It is supported by all browsers:
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
Internet Explorer 11 (or earlier versions) does not support domtokenlist.value.
Related Pages
- Previous Page toggle()
- Next Page values()
- Go to Parent Directory HTML DOMTokenList