javascriot check if element has children of type code example Example: how to check if a tag has any chidren tag.hasChildNodes()