The DOM implementation property in HTML is used to return the DOMImplementation object associated with the current document. The DOMImplementation is the interface that represents a method providing the object which is not dependent on any particular document.Â
Syntax
document.implementationReturn Value: It returns the document implementation object.Â
Example 1: In this example, we will use the DOM implementation property
<!--Driver Code Starts-->
<!-- HTML code to check the document
has HTML DOM 1.0 feature -->
<!DOCTYPE html>
<html>
<head>
<title>
HTML DOM implementation Property
</title>
</head>
<body>
<h2>HTML DOM implementation Property</h2>
<p>Click on button to check the document
has HTML DOM 1.0 feature</p>
<!--Driver Code Ends-->
<button onclick="DomFunction()">
Click Here!
</button>
<p id="demo"></p>
<script>
function DomFunction() {
let obj = document.implementation;
document.getElementById("demo").innerHTML
= obj.hasFeature("HTML", "1.0");
}
</script>
<!--Driver Code Starts-->
</body>
</html>
<!--Driver Code Ends-->
Example 2: In this example, we will use the DOM implementation property
<!--Driver Code Starts-->
<!DOCTYPE html>
<html>
<head>
<title>
HTML DOM implementation Property
</title>
</head>
<body>
<h2>HTML DOM implementation Property</h2>
<!--Driver Code Ends-->
<script>
let DOM_Name = "HTML";
let DOM_Ver = "1.0";
let GFG = document.implementation.hasFeature(
DOM_Name, DOM_Ver);
alert("DOM " + DOM_Name + " " + DOM_Ver
+ " supported? " + GFG);
</script>
<!--Driver Code Starts-->
</body>
</html>
<!--Driver Code Ends-->