📅  最后修改于: 2022-03-11 15:03:56.788000             🧑  作者: Mango
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.