HTML DOM firstChild Property
Example
Return the first node of the document:
document.firstChild;
Try it »
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





All major browsers support the firstChild property
Syntax
node
.firstChild
Technical Details
| Return Value: | The first child node of a node. |
|---|---|
| DOM version | Core Level 1 Node Object |
Element object