The documentElement property returns the documentElement of a document, as an Element object.
Read more about the Element object in our Element object reference.
For HTML documents the returned object is the HTML element.
Note: If the HTML element is missing, the return value is null.
![]()
The documentElement property is supported in all major browsers.
| Return Value: | The document's documentElement, as an Element object. |
|---|---|
| DOM Version | Core Level 1 |
Your message has been sent to W3Schools.