<INPUT id="textInput" type="text" value="text-to-enter"></INPUT>
function focusInput() { var main = document.getElementById('textInput'); main.focus(); } function blurInput() { var main = document.getElementById('textInput'); main.blur(); }