X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM firstChild Property

Element Object Reference Element Object

Example

Return the first child node of the document:

document.firstChild;

Try it yourself »


Definition and Usage

The firstChild property returns the first child node of the specified node, as a Node object.

Note: In HTML, the document itself is the parent node of the HTML element, HEAD and BODY are child nodes of the HTML element.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The firstChild property is supported in all major browsers.


Syntax

node.firstChild

Technical Details

Return Value: The first child of the node, as a Node object
DOM Version Core Level 1 Node Object


Element Object Reference Element Object


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook