document change html element text code example
Example 1: change text of element js
document.getElementById("p1").innerHTML = "New text!";
Example 2: javascript element edit text
// example:
document.querySelector(`.message`).textContent = `New Message`;
// syntax:
// document.querySelector(`.<class-name>`).textContent = `<new-value>`;