changing the text of a p tag in javascript code example Example: change text of element js Click to copydocument.getElementById("p1").innerHTML = "New text!";