Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

supports

« DOM Reference

Summary

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

Syntax

boolean = element.supports(feature[, 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.

Document Tags and Contributors

 Last updated by: Dria,