Skip to content
Related Articles

Related Articles

HTML | DOM documentElement Property

View Discussion
Improve Article
Save Article
  • Last Updated : 16 Jun, 2022

The DOM documentElement property is used to return the documentElement as an Element Object. It is read-only property. It return a <HTML> Element. 



Return Value: It returns the documentElement of the document or an element object. 

Below program illustrates the documentElement property in HTML: 



<!DOCTYPE html>
            DOM documentElement Property
            function Geeks() {
                var x = document.documentElement.nodeName;
                document.getElementById("sudo").innerHTML = x;
            <h2>DOM documentElement Property</h2>
            <button onclick = "Geeks()">
            <p id = "sudo"></p>

Output: Before Click on the button:


After Click on the button:


Supported Browsers: The browser supported by DOM documentElement property are listed below:

  • Google Chrome 1 and above
  • Edge 12 and above
  • Internet Explorer 5 and above
  • Firefox 1 and above
  • Opera 7 and above
  • Safari 1 and above
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!