change value of input javascript by name code example
Example: javascript assign value to input using name
document.querySelector('input[name="myInput"]').value = 'Whatever you want!';
document.querySelector('input[name="myInput"]').value = 'Whatever you want!';