VOOZH about

URL: https://www.geeksforgeeks.org/html/html-dom-length-property/

⇱ HTML DOM length Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM length Property

Last Updated : 11 Jul, 2025

The DOM length property in HTML is used to get the number of items in a NodeList object. A NodeList is a collection of child Nodes. For example, the NodeList of the body will contain all the child nodes in the body i.e. paragraphs, comments, headings, script, etc.

Syntax:

nodelist.length

Return Value: It returns a numeric value that represents the number of nodes in the nodelist. 

Example: The below program illustrates the DOM length property in HTML:

Output:

👁 Image

Supported Browsers: The browser supported by DOM length property are listed below: 

Comment