javascript change content of div code example
Example 1: javascript set text of div
document.getElementById("content").innerHTML = "whatever";
Example 2: change text of element js
document.getElementById("p1").innerHTML = "New text!";
Example 3: javascript replace content of div
document.getElementById("test").innerHTML = "new content"
Example 4: how to change text of div in javascript
document.getElementById("content").innerHTML = "whatever";
Example 5: javascript update text in div
fieldNameElement.innerHTML = "My new text!";