Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
137
rated 0 times [  139] [ 2]  / answers: 1 / hits: 76750  / 14 Years ago, sat, july 17, 2010, 12:00:00

How do you programmatically select the text of an input field on iOS devices, e.g. iPhone, iPad running mobile Safari?



Normally it is sufficient to call the .select() function on the <input ... /> element, but this does not work on those devices. The cursor is simply left at the end of the existing entry with no selection made.


More From » iphone

 Answers
47
input.setSelectionRange(0, 9999);


https://developer.mozilla.org/en/DOM/Input.select


[#96196] Thursday, July 15, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dustin

Total Points: 599
Total Questions: 105
Total Answers: 106

Location: Belarus
Member since Tue, Mar 14, 2023
1 Year ago
dustin questions
;