Revision 477067 of element.supports

  • Revision slug: Web/API/element.supports
  • Revision title: element.supports
  • Revision id: 477067
  • Created:
  • Creator: kscarfone
  • Is current revision? No
  • Comment Updated tags

Revision Content

{{ DomRef() }}

Summary

The supports method tests if this DOM implementation supports a particular feature.

Syntax

boolean = element.supports(feature{{ mediawiki.external(', version') }})

Parameters

feature is a string that contains the name of the feature (e.g., "") version is a string containing the version number of the feature.

Example

if ( document.supports("package", "4.0") ) {     // do something that only package 4.0 allows }

Notes

If version is not supplied, the method returns true if any version of the specified feature is supported.

Specification

Not part of the specification.

Revision Source

<p>{{ DomRef() }}</p>
<h3 id="Summary" name="Summary">Summary</h3>
<p>The supports method tests if this DOM implementation supports a particular feature.</p>
<h3 id="Syntax" name="Syntax">Syntax</h3>
<p>boolean = element.supports(feature{{ mediawiki.external(', version') }})</p>
<h3 id="Parameters" name="Parameters">Parameters</h3>
<p>feature is a string that contains the name of the feature (e.g., "") version is a string containing the version number of the feature.</p>
<h3 id="Example" name="Example">Example</h3>
<pre>
if ( document.supports("package", "4.0") ) {     // do something that only package 4.0 allows }

</pre>
<h3 id="Notes" name="Notes">Notes</h3>
<p>If version is not supplied, the method returns true if any version of the specified feature is supported.</p>
<h3 id="Specification" name="Specification">Specification</h3>
<p>Not part of the specification.</p>
Revert to this revision