Easy Tutorial
❮ Prop Meter Low Jsref Regexp G ❯

DOM Node hasChildNodes() Method

Element Object

Example

Check all child nodes of an element:

Output result:


Definition and Usage

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


Browser Support

All major browsers support the hasChildNodes() method.


Syntax

Parameters

None

Return Value

Type Description
Boolean Returns true if the node has child nodes, otherwise returns false.

Technical Details

| DOM Version | Core Level 1 Node Object | | --- | --- |


Element Object

❮ Prop Meter Low Jsref Regexp G ❯