function redirect() { var t = document.getElementById('addressText'); var addr = t.value; window.location = addr; } <form> <input type="text" id="addressText" /> <input type="button" id="addressSubmit" value="Go!" onclick="redirect();" /> </form>