how to call all node in javascript

JavaScript
var myNodelist = document.querySelectorAll("p");

var i;

for (i = 0; i < myNodelist.length; i++) {

  myNodelist[i].style.backgroundColor = "red";

}
 
Source

Also in JavaScript: