<html>
<body>
<h1>JavaScript Statements</h1>
<h2>The for Loop</h2>
<p>Loop a NodeList and change the color of all p elements in the list:</p>
<p>This is a p element</p>
<p>This is a p element.</p>
<p>This is a p element.</p>
<script>
const myNodelist = document.getElementsByTagName("P");
for (let i = 0; i < myNodelist.length; i++) {
myNodelist[i].style.color = "red";
}
</script>
</body>
</html>