TOC PREV NEXT INDEX

domref



hasChildNodes


hasChildNodes is a method that returns a boolean value indicating whether the current element has children or not.

Syntax

[ true | false ] = element.hasChildNodes()
 

Parameters

boolean true | false

Example

t1 = document.getElementById("table-data");
 
if ( t1.hasChildNodes() ) {
 
    // table has kids
 
}
 

Notes

Note that element.hasChildNodes, without the parentheses, is the incorrect usage of this method, and always returns a true value indicating that the method is available on the object. Do not be fooled.

Specification

hasChildNodes
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX