HTML | DOM documentElement Property
The DOM documentElement property is used to return the documentElement as an Element Object. It is read-only property. It return a <HTML> Element.
Syntax:
document.documentElement
Return Value: It returns the documentElement of the document or an element object.
Below program illustrates the documentElement property in HTML:
Example:
<!DOCTYPE html> <html> <head> <title> DOM documentElement Property </title> <script> function Geeks() { var x = document.documentElement.nodeName; document.getElementById("sudo").innerHTML = x; } </script> </head> <body> <center> <h1>GeeksforGeeks</h1> <h2>DOM documentElement Property</h2> <button onclick = "Geeks()"> Submit </button> <p id = "sudo"></p> </center> </body> </html> |
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
- Internet Explorer
- Firefox
- Opera
- Safari
Recommended Posts:
- HTML | DOM name Property
- HTML | DOM li value Property
- HTML | DOM specified Property
- HTML | DOM dir Property
- HTML | DOM value Property
- HTML | DOM Bdo dir Property
- HTML | DOM id Property
- HTML | DOM URL Property
- HTML | DOM del cite Property
- HTML | DOM Ol start Property
- HTML | DOM del dateTime Property
- HTML DOM tagName Property
- HTML | KeyboardEvent which Property
- HTML | DOM className Property
- HTML | DOM Fieldset name Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



