SetText JavaScript
document.getElementById("myBtn").textContent = 'Hello World';
// OR
document.getElementById("p1").innerHTML = "New text!";
Undefined
document.getElementById("myBtn").textContent = 'Hello World';
// OR
document.getElementById("p1").innerHTML = "New text!";