haschildnodes

let foo = document.getElementById('foo');

if (foo.hasChildNodes()) {
  // Do something with 'foo.childNodes'
}
Smoggy Swiftlet