HTML DOMTokenList supports() Method
- Previous Page replace()
- Next Page toggle()
- Go to Parent Directory HTML DOMTokenList
Definition and Usage
If the token in the DOMTokenList is one of the attribute-supported tokens, the supports() method returns true.
Example
Example 1
Check if "allow-forms" is supported:
const list = element.sandbox; list.supports("allow-forms");
Example 2
Check if "allow-nonsense" is supported:
const list = element.sandbox; list.supports("allow-nonsense");
Syntax
domtokenlist.supports(Token)
Parameter
Parameter | Description | Token | Required. The tag to be checked. |
---|
Return Value
Type | Description |
---|---|
Boolean Value | If the tag is supported, it returns true; otherwise, it returns false. |
Browser Support
domtokenlist.supports() 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.supports().
Related Pages
- Previous Page replace()
- Next Page toggle()
- Go to Parent Directory HTML DOMTokenList