This site is mobile accessible. Press the "Tap Here" button to use a different font-size.



Smartphone icons created by Freepik - Flaticon

JS HTML DOM

Hello World!

Hello Norway!

Click the button to change the color of all p elements.

// button code
onclick="myFunction()

// myFunction()
function myFunction() {
  const myNodelist = document.querySelectorAll("p");
  for (let i = 0; i < myNodelist.length; i++) {
    myNodelist[i].style.color = "red";
  }
}