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