HTML DOMTokenList supports()
❮ The DOMTokenList ObjectExamples
Check if "allow-forms" is supported:
const list = element.sandbox;
list.supports("allow-forms");
Try it Yourself »
Check if "allow-nonsense" is supported:
const list = element.sandbox;
list.supports("allow-nonsense");
Try it Yourself »
Definition and Usage
The supports()
method returns true
if a token in a DOMTokenList is one of the attribute's supported tokens.
See Also:
Syntax
domtokenlist.supports(token)
Parameters
Parameter | Description |
token | Required. The token to check for. |
Return Value
Type | Description |
Boolean | true if the token is supported, otherwise false . |
Browser Support
domtokenlist.supports()
is a DOM Level 4 (2015) feature.
It is supported in all modern browsers:
Chrome | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes |
domtokenlist.supports()
is not supported in Internet Explorer 11 (or earlier).
❮ The DOMTokenList Object