Easy Tutorial
❮ Dom Met Element Hasattribute Dom Met Element Getelementsbytagname ❯

XML DOM hasChildNodes() Method



Definition and Usage

The hasChildNodes() method returns true if the node has child nodes, otherwise it returns false.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and returns whether the first <book> element has child nodes:

Example

Output:


❮ Dom Met Element Hasattribute Dom Met Element Getelementsbytagname ❯