YouTip LogoYouTip

Met Node Haschildnodes

# DOM Node hasChildNodes() Method [![Image 8: Element Object Reference](#) Element Object](#) ## Example Check if an element has any child nodes: document.getElementById("myList").hasChildNodes() Output: true [Try it yourself Β»](#) * * * ## Definition and Usage The hasChildNodes() method returns true if a node has any child nodes, otherwise it returns false. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The hasChildNodes() method is supported by all major browsers. * * * ## Syntax _node_.hasChildNodes() ## 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 Html IdMet Node Hasattributes β†’