W3cubDocs

/DOM

Node.isSupported

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The Node.isSupported()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

boolValue = element.isSupported(feature, version)

Parameters

feature
Is a DOMString 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 defined within the core DOM specification are listed on the DOM Level 2 Conformance Section.
version
Is a DOMString containing the version number of the feature to test. In 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.
 var main = document.getElementById('doc');
 var output = main.isSupported('HTML', '2.0');
</script>

Specifications

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support No ? 1 — 22 ? ? ?
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support No No ? 4 — 22 ? ? ?

See also

  • The Node interface it belongs to.

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Node/isSupported