代码示例:(标识:jsck_element_children_2)
<!DOCTYPE html>
<html>
<body>
<h1>Element 对象</h1>

<h2>children 属性</h2>

<p>改变 "myDIV" 的第二个子元素 (index 1) 的背景:</p>

<div id="myDIV">
  <p>我是段落。</p>
  <p>我是段落。</p>
  <p>我是段落。</p>
</div>

<script>
const collection = document.getElementById("myDIV").children;
collection[1].style.backgroundColor = "yellow";
</script>

</body>
</html>
运行结果: