<html>
<body>
<h1>The NodeList Object</h1>
<h2>The item() or [] Method</h2>
<!-- This is a comment node! -->
<p>The node names of the body element's child nodes are:</p>
<p id="demo"></p>
<p>Note: Whitespace between elements are text nodes.</p>
<script>
const list = document.body.childNodes;
let text = "";
for (let i = 0; i < list.length; i++) {
text += list[i].nodeName + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_nodelist_length_childloop by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:39:46 GMT -->
</html>