TOC PREV NEXT INDEX

domref



firstChild


firstChild returns the first node in the list of direct children of the document.

Syntax

child = document.firstChild
 

Parameters

child is a node of the type element.

Example

function fChild() {
 
  f = document.firstChild;
 
  alert(f.tagName);
 
} // returns: HTML
 

Notes

Note that you may have to recurse into the DOM tree with this property to get the the child nodes you expect, since HTML is almost always given as the first child of the document itself.

Specification

firstChild


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX