![]() |
VOOZH | about |
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.lengthReturn 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:
Supported Browsers: The browser supported by DOM length property are listed below: