replace div content js code example
Example 1: change text of element js
document.getElementById("p1").innerHTML = "New text!";
Example 2: how to change text of div in javascript
document.getElementById("content").innerHTML = "whatever";
document.getElementById("p1").innerHTML = "New text!";
document.getElementById("content").innerHTML = "whatever";