const myElement = document.getElementById('foo'); for (let i = 0; i < myElement.children.length; i++) { console.log(myElement.children[i].tagName); } // Logs the name of all the children.