value input html code example
Example 1: javascript set input field value
document.getElementById("myInputID").value = "My Value"; //set value on myInputID
Example 2: default value input
<input type="text" id="fname" name="fname" value="John">
document.getElementById("myInputID").value = "My Value"; //set value on myInputID
<input type="text" id="fname" name="fname" value="John">