javascript set value of input by name code example
Example 1: Javascript get text input value
var inputValue = document.getElementById("myTextInputID").value;
Example 2: javascript assign value to input using name
document.querySelector('input[name="myInput"]').value = 'Whatever you want!';