<!DOCTYPE html>
<html>
<body>
<h1>The NodeList Object</h1>
<h2>The item() Method</h2>
<div id="myDIV" style="border:1px solid black; padding:16px;">
<p>I am one.</p>
<p>I am two.</p>
<p>I am three.</p>
</div>
<p>Click "Change" to change the content of the first p element inside "myDIV".</p>
<button onclick="myFunction()">Change</button>
<p id="demo"></p>
<script>
function myFunction() {
const div = document.getElementById("myDIV");
const list = div.querySelectorAll("p");
list[0].innerHTML = "Paragraph changed.";
}
</script>
</body>
</html>