DOMImplementation.hasFeature

The DOMImplementation.hasFeature() method returns a Boolean (en-US) flag indicating if a given feature is supported.

The different implementation fairly diverged in what kind of features was reported. The latest version of the spec settled to force this method to always return true, except for SVG features, where the functionnality was accurate and in use.

Syntax

flag = document.implementation.hasFeature(feature, version);

Parameters

feature

Is a DOMString representing the feature name.

version

Is a DOMString representing the version of the specification defining the feature.

Specifications

Specification
DOM Standard
# dom-domimplementation-hasfeature

Browser compatibility

BCD tables only load in the browser

See also