This site is mobile accessible. Press the "Tap Here" button to use a smaller 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.

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

Note: even the mobile specific paragraph (p0) color is also changed to red.