how to tell if an html element has a child element code example Example: how to check if a tag has any chidren tag.hasChildNodes()