You are here: Reference > JavaScript > client-side > HTML DOM > methods > hasFeature (implementation)

hasFeature method (implementation)

Browser support:
Returns whether the specified feature and version is implemented by the browser.
To detect whether a DOM module and version is supported by a node, use the isSupported method.

Syntax:

object.hasFeature (feature, version);
You can find the related objects in the Supported by objects section below.

Parameters:

feature
Required. String that specifies the name of the feature. This parameter is case-insensitive.
Some of the possible values:
XML
XML DOM standard.
HTML
HTML DOM standard.
version
Required in Firefox and Opera, optional in Internet Explorer, Google Chrome and Safari. String that specifies the version number (such as '1.0').

Return value:

Boolean. One of the following values:
false Not implemented.
true Implemented.

Example HTML code 1:

This example illustrates the use of the hasFeature method:
<head>
    <script type="text/javascript">
        function CheckFeature () {
            alert (document.implementation.hasFeature ("HTML","1.0"));
        }
    </script>
</head>
<body>
    <button onclick="CheckFeature ()">Is the DOM HTML 1.0 standard is implemented?</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

External links:

User Contributed Comments

Post Content

Post Content