MDN wants to talk to developers like you:

setSelectionRange( start, end )
Return type: no return value
Sets the selected portion of the textbox, where the start argument is the index of the first character to select and the end argument is the index of the character after the selection. Set both arguments to the same value to move the cursor to the corresponding position without selecting text.

Document Tags and Contributors

 Contributors to this page: Sheppy, trevorh, Marsf, Mgjbot, Fredchat, Ptak82, Thunderseb, Dria
 Last updated by: Sheppy,