Search w3schools.com:

SHARE THIS PAGE

DOM Document documentElement Property

Document Object Reference Document Object

Example

Return the document's documentElement:

document.documentElement;

Try it yourself »

Definition and Usage

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.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The documentElement property is supported in all major browsers.


Syntax

document.documentElement

Technical Details

Return Value: The document's documentElement, as an Element object.
DOM Version Core Level 1


Document Object Reference Document Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]