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

HTML DOM length Property

Element Object Reference Element Object

Example

Return the number of child nodes of the body element:

document.body.childNodes.length;

The result could be:

8

Try it yourself »


Definition and Usage

The length property returns the number of nodes in a collection.

A Node object's collection of child nodes is an example of a NodeList object


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The length property is supported in all major browsers.


Syntax

nodelist.length

Technical Details

Return Value: A Number, representing the number of nodes in the nodelist
DOM Version Core Level 1 Nodelist 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

SHARE THIS PAGE

facebook