get string from textbox javascript

JavaScript
<input id="word">

var word = document.getElementById("word").value;
Source

Also in JavaScript: