asp.net.ph

Skip Navigation Links

documentElement Property

document Properties   Object Properties Summary


Returns a reference to the document object.

Syntax


HTML N/A
Script oElement = document.documentElement;

Possible Values


oElement Reference to the document element.

The property is read-only with no default value.

Remarks

This is a convenience attribute that allows direct access to the child node that is the root element of the document. For HTML documents, this is the element with the tagName "HTML".

Example

The following sample demonstrates use of the documentElement property to retrieve the innerHTML of the entire document.

<script language="JavaScript">
function getDoc ( ) {
var docData = document.documentElement.innerHTML;
alert ( docData );
}
</script>

This feature requires Microsoft® Internet Explorer® 5 or later.

 Show me 

Applies To

document



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note