Node.isSupported()

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

The isSupported() method of the Node interface returns a boolean flag containing the result of a test whether the DOM implementation implements a specific feature and this feature is supported by the specific node.

Syntax

isSupported(feature, version);

Parameters

feature

A string containing the name of the feature to test. This is the same name which can be passed to the method hasFeature on DOMImplementation. Possible values are listed in Conformance Section.

version

A string containing the version number of the feature to test. For DOM Level 2, version 1, this is the string 2.0. If the version is not specified, supporting any version of the feature will cause the method to return true.

Example

<div id="doc">
</div>

<script>
 // Get an element and check to see if its supports the DOM2 HTML Module.
 const main = document.getElementById('doc');
 const output = main.isSupported('HTML', '2.0');
</script>

Specifications

This feature is not part of any specification. It is no longer on track to become a standard.

Browser compatibility

BCD tables only load in the browser

See also

  • The Node interface it belongs to.