how to change the content of a div using an element in javscript code example Example: change innerhtml document.getElementById("p1").innerHTML = "New text!";