document.getElementById("p1").innerHTML = "New text!";
document.getElementById("demo").innerHTML = ""; // Replaces the content of <p> with an empty string