HTML DOM Element hasChildNodes()
HTML DOM Element hasChildNodes() Method
The hasChildNodes() is a read-only method and it returns true if the specified node has any child nodes else false. Whitespaces are considered text nodes.
Syntax:-
Its syntax is:- element.hasChildNodes()
Return:-
Its return is:- true if element has child nodes else false