html text input to var code example
Example 1: How to save input from box html
function getInputFromTextBox() {
var input = document.getElementById("userInput").value;
alert(input);
}
Example 2: get value from textbox in vanilla javascript
document.getElementById("myText").value = "Johnny Bravo";