DOM:element.isSupported
From MDC
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);
-
featureThe name of the feature to test. This is the same name which can be passed to the methodhasFeatureon DOMImplementation. Possible values defined within the core DOM specification are listed on the DOM Level 2 Conformance Section. -
versionThis is the version number of the feature to test. In DOM Level 2, version 1, this is the string2.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