<html>
<body>
<h1>The Element Object</h1>
<h2>The children Property</h2>
<p>Change background of the second child element (index 1) of "myDIV":</p>
<div id="myDIV">
<p>I am a paragraph</p>
<p>I am a paragraph</p>
<p>I am a paragraph</p>
</div>
<script>
const collection = document.getElementById("myDIV").children;
collection[1].style.backgroundColor = "yellow";
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_element_children2 by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 15:18:57 GMT -->
</html>