📌  相关文章
📜  第一个子元素 javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:33.410000             🧑  作者: Mango

代码示例1
Both these will give you the first child node:

console.log(parentElement.firstChild); // or
console.log(parentElement.childNodes[0]);

If you need the first child that is an element node then use:

console.log(parentElement.children[0]);