TOC PREV NEXT INDEX

Put your logo here!


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

core


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX