Visit Mozilla.org

DOM:element.isSupported

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

Tests whether the DOM implementation implements a specific feature and that feature is supported by this node.

[edit] Syntax

var isSupported = element.isSupported(feature, version);
  • feature 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 This is 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.

[edit] Example

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

[edit] Notes

To check if any version of the DOM specification is supported, you can pass in null as the version instead of a string.

Related methods: document.implementation.hasFeature

[edit] Specification

DOM Level 2 Core: isSupported