set value in html from javascript code example
Example 1: change innerhtml
document.getElementById("p1").innerHTML = "New text!";
Example 2: Javascript get text input value
var inputValue = document.getElementById("myTextInputID").value;
document.getElementById("p1").innerHTML = "New text!";
var inputValue = document.getElementById("myTextInputID").value;