how to set a js string to a <p> html element through id code example
Example 1: change text of element js
document.getElementById("p1").innerHTML = "New text!";
Example 2: .innerhtml
// .innerHTML method is used to change the html contents of a DOM object
document.getElementById("demo").innerHTML = "Paragraph changed!";