Search w3schools.com:

SHARE THIS PAGE

DOM Node childNodes Property

Node Object Reference Node Object

Example

Get a collection of the body element's child nodes:

document.body.childNodes;

Try it yourself »

Definition and Usage

The childNodes property returns a collection of a node's child nodes, as a NodeList.

Read more about the NodeList object in our NodeList object reference.

Tip: You can use the length property to determine the number of child nodes, then you can loop through all child nodes and extract the info you want.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The childNodes property is supported in all major browsers.


Syntax

node.childNodes

Technical Details

Return Value: A NodeList object, representing a collection of nodes
DOM Version Core Level 1


Node Object Reference Node Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]