set value using javascript

JavaScript
document.getElementById("myText").value = "your string"; var inputValue = document.getElementById("myTextInputID").value;

Source

Also in JavaScript: