document.getElementById("fname") set value code example
Example: Javascript get text input value
var inputValue = document.getElementById("myTextInputID").value;
var inputValue = document.getElementById("myTextInputID").value;