I\'m using the following HTML code to autoselect some text in a form field when a user clicks on the field:
Instead of binding to onfocus event you must bind this action into onclick event and it will work as you wanted.