javascript set element content code example
Example 1: change innerhtml
document.getElementById("p1").innerHTML = "New text!";
Example 2: set text of dom element
document.getElementById("myBtn").textContent = 'Hello World';
document.getElementById("p1").innerHTML = "New text!";
document.getElementById("myBtn").textContent = 'Hello World';