HTML DOM documentElement property
Example
Return the documentElement of the document:
document.documentElement;
Try it »
Definition and Usage
The documentElement property returns the document element of a document as an element object.
For an HTML document, the returned object is an HTML element.
Note: If the HTML element is missing, the return value is null.
Browser support





All major browsers support the documentElement property
Syntax
document.documentElement
Technical Details
| Return Value: | The document element of the document, as an element object. |
|---|---|
| DOM version | Core Level 1 Document object |
Document Object