you must set focus to your input:
document.forms['your_form'].elements['your_textbox'].focus();
For your example above:
document.getElementById('textbox-email').focus()
After that you should select it:
either add this onfocus attribute to your inputs (better)
<input type="text" onfocus="this.select()" />
Or use this jQuery snippet (best):
$(document).ready(function() { $("#textbox-email").focus(function() { $(this).select(); } ); });
Pure Javascript:
var element = document.getElementById('textbox-email'); element.onfocus = function() {element.select();} document.getElementById('textbox-email').focus();
Add all of this to the window.onload or onload attribute of the body tag.
source share