HTML DOM firstChildProperty

元素对象参考手册Element Object

Example

Return the first node of the document node:

document.firstChild;

Try it yourself »

Definition and Usage

The firstChild property returns the first child node of the selected node.

Note:If the selected node has no child nodes, this property returns NULL.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the firstChild property


Syntax

node.firstChild

Technical Details

Return Value: The first child node of the node.
DOM Version Core Level 1 Node Object


元素对象参考手册Element Object

Other Extensions