how to check child element in javascript code example Example: how to check if a tag has any chidren tag.hasChildNodes()