javaScript set Значение поля ввода
document.getElementById("myInputID").value = "My Value"; //set value on myInputID
Grepper
document.getElementById("myInputID").value = "My Value"; //set value on myInputID
document.getElementById("ID").value = "TEXT OR VARIABLE";
var inputValue = document.getElementById("myTextInputID").value;
<input type="text" id="example">
<input type="submit" value="Submit" onclick="document.getElementById('example').setAttribute('value','My default value')">