Name

Node.hasChildNodes( ) — determine whether a node has children

Availability

DOM Level 1 Core

Synopsis

boolean hasChildNodes(  );

Returns

true if this node has one or more children; false if it has none.

See Also

Node.childNodes

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.