<!DOCTYPE html>
<html>
<body>
<h1>The Nodelist Object</h1>
<h2>The length Property</h2>
<button onclick="myFunction()">Change</button>
<p>Click "Change" to change the font size of all p elements inside "myDIV".</p>
<div id="myDIV" style="border:1px solid black; padding:16px;">
<p>I am a paragraph.</p>
<p>I am a paragraph.</p>
<p>I am a paragraph.</p>
</div>
<script>
function myFunction() {
const div = document.getElementById("myDIV");
const list = div.querySelectorAll("p");
for (let i = 0; i < list.length; i++) {
list[i].style.fontSize = "24px";
}
}
</script>
</body>
</html>