HTML - DOM Document implementation Property



HTML DOM document implementation property returns a DOMImplementation object which is associated with the current document.

Syntax

document.implementation;

Return Value

It returns the document's implementation object.

Examples of HTML DOM Document 'implementation' Property

Here are few examples of this property.

Check for Feature DOM 1.0

The following example returns whether this document has the feature DOM 1.0

<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        HTML DOM document implementation Property
    </title>
</head>
<body>
    <p>
        Click to know if this document 
        has the feature DOM 1.0
    </p>
    <button onclick="fun()">Click me</button>
    <p id="imp"></p>
    <script>
        function fun() {
            let x = document.implementation.hasFeature("DOM", "1.0");
            document.getElementById("imp").innerHTML = x;
        }
    </script>
</body>
</html>

Check for Feature Noodles

The following example returns whether this document has the feature Noodles

<!DOCTYPE html>
<html lang="en">
<head>
    <title>
        HTML DOM document implementation Property
    </title>
</head>
<body>
    <p>
        Click to know if this document
        has the feature Noodles
    </p>
    <button onclick="fun()">Click me</button>
    <p id="imp"></p>
    <script>
        function fun() {
            let x = document.implementation.hasFeature("Noodles", "1.0");
            document.getElementById("imp").innerHTML = x;
        }
    </script>
</body>
</html>

Supported Browsers

Property Chrome Edge Firefox Safari Opera
implementation Yes 1 Yes 12 Yes 1 Yes 1 Yes 12.1
html_dom_document_reference.htm
Advertisements