<INPUT id="textInput" type="text" value="text-to-select"></INPUT>
function selectInput() { var main = document.getElementById('textInput'); main.select(); }