Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM documentElement property

HTML DOM documentElement property

Document Object Reference Document Object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Reference Document Object