update text content of element javascript code example
Example 1: change text of element js
document.getElementById("p1").innerHTML = "New text!";
Example 2: javascript update text in div
fieldNameElement.innerHTML = "My new text!";
document.getElementById("p1").innerHTML = "New text!";
fieldNameElement.innerHTML = "My new text!";