There are times when we need to select all text in input field for editing. Well, It can be done easily in javascript.
The following script helps us to accomplish it,
<input onClick="this.select();" />
For mobile safari,
<input onClick="this.setSelectionRange(0, this.value.length)" />
The following script helps us to accomplish it,
<input onClick="this.select();" />
For mobile safari,
<input onClick="this.setSelectionRange(0, this.value.length)" />
Comments
Post a Comment