English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM documentElement Property

HTML DOM Document Object

documentElementThe read-only property returns the element as the root element of the document, as an element object.

For HTML documents, the returned object is the <html> element.

Please refer todocument.bodyProperty, which returns the element.

Syntax:

document.documentElement
var root = document.documentElement;
Test See‹/›

Browser Compatibility

All browsers fully support the documentElement property:

Property
documentElementYesYesYesYesYes

Technical Details

Return Value:The element is the root element of the document
DOM Version:DOM Level1

HTML DOM Document Object