What's new? | Help | Directory | Sign in
Google
             
Search
for
Updated Sep 19, 2008 by pilgrim
Labels: about-dom, is-dom-property
DocumentDocumentElementProperty  
The document.documentElement property

Values

The document.documentElement property returns an Element which is the root of the document where it belongs. Typically, in a HTML document, this will be the HTML element, in a SVG document this will be the svg element, and so on.

This property is read-only.

Remarks

1 Internet Explorer does not support this property in quirks mode. You'll have to resort to document.body instead. 2 Although documentElement is the document root, it can have siblings, which can be text nodes, comments, xml processing instructions or doctypes.

Usage

Browser compatibility

Compatibility table legend

Test IE8 IE7 IE6 FF3 FF2 Saf3 Op9 Chrome
typeOf(document.documentElement) != 'undefined' Y Y Y Y Y Y Y Y

Further reading


Sign in to add a comment