eg: <input type="text" id="txt_field_name" /> 1. var obj = document.getElementById('# txt_field_name ') ; obj.select();