how to replace content in a p tag in javascript code example
Example 1: javascript set text of div
document.getElementById("content").innerHTML = "whatever";
Example 2: .innerhtml
// .innerHTML method is used to change the html contents of a DOM object
document.getElementById("demo").innerHTML = "Paragraph changed!";