javascript set value of element code example
Example 1: change text of element js
document.getElementById("p1").innerHTML = "New text!";
Example 2: set value using javascript
document.getElementById("myText").value = "your string";
Example 3: javascript change element id
var element = document.getElementById("oldID");
element.id = "newID";