Linked Questions
15 questions linked to/from Programmatically selecting text in an input field on iOS devices (mobile Safari)
5 votes
4 answers
23k views
Selecting text on focus using jQuery not working in iPhone iPad Browsers [duplicate]
We are developing Web-App for Mobile browsers, we would like text of any input box to get selected whenever input-box get focus. Below answer fixes the issue for Desktop chrome/safari browser. Below ...
724 votes
30 answers
745k views
Selecting all text in HTML text input when clicked
I have the following code to display a textbox in a HTML webpage. <input type="text" id="userid" name="userid" value="Please enter the user ID" /> When the page displays, the text contains the ...
85 votes
9 answers
82k views
Selecting text on focus using jQuery not working in Safari and Chrome
I have the following jQuery code (similar to this question) that works in Firefox and IE, but fails (no errors, just doesn't work) in Chrome and Safari. Any ideas for a workaround? $("#souper_fancy")...
59 votes
6 answers
96k views
Mobile Safari Autofocus text field
In Mobile Safari I am unable to focus onto a text field after setting a delay period. I'm attaching some example code showcasing the issue. If, onclick of the button, you trigger .focus(), everything ...
18 votes
7 answers
9k views
How to programmatically focus on a textfield on page load for mobile safari?
Note: Due to a work-related change, I can no longer verify the answers posted here. Most likely, I will never be able to accept an answer down below. The information posted here is useful IMO, so I ...
6 votes
3 answers
5k views
Why does select() not work on Safari with ReactJS?
I'd like to get a TextField to select the whole text currently in the field whenever I click/tap/focus on the field. The following code works in Chrome (71.0.3578.98), but not in Safari (12.0.2). Any ...
6 votes
6 answers
6k views
Select the content of input / textbox field on tap / click
My kingdom for a selectable textbox The challenge: Creating a cross browser textbox/input field of 'any' type that can select its contents on click/tap. A problem that has eluded many for years. ...
10 votes
2 answers
3k views
Programmatically trigger copy menu in iOS safari using javascript?
I'm trying to implement a user-friendly way to copy some text from a text input field to the clipboard on iOS/Safari. I understand there is no way to programmatically do it on this platform, but I was ...
8 votes
1 answer
7k views
Kendo Grid how to programmatically focus a grid cell and block select the text
I have a kendo grid with edit mode set to incell. What is the most elegant way of programmatically focus a particular cell to force it into an edit mode? Let's say I have a grid where column 1 and 6 ...
0 votes
1 answer
2k views
Hide Element When Form Field Focus
I am working on a web app for display on iPhone and when the form field becomes active, the nav (.nav-btns) at the bottom of my page gets in the way. I'd like to hide that element when any form ...
2 votes
0 answers
3k views
On Safari Mobile, auto-select all the text of a read-only input on focus
I'm trying to use an input text box as a URL sharing widget. Fairly standard: when you click on the textbox, all of the text inside is automatically highlighted to make it easy to copy and paste. It's ...
1 vote
1 answer
744 views
How to highlight desktop Safari text selection in <div> after Range.setStart / Range.setEnd?
I am attempting to use javascript to modify a user's selection of text within a non-editable <div> element using Range.setStart and Range.setEnd. Specifically, I want the user to be able to ...
0 votes
1 answer
555 views
Select ALL in the input form contents on focus on iOS / Android
I have the following code to select all the contents of my input element that has id="embedurl" $('#embedurl').focus(function(event) { setTimeout(function() { $('#embedurl').select(); ...
2 votes
0 answers
678 views
Detecting if HTMLInputElement.select is actually supported
People say UA sniffing is bad. So I'm trying to do a feature detection for HTMLInputElement.select(). My reason is that, on iOS mobile devices, the function is supported, but it does not actually ...
0 votes
1 answer
124 views
ipad app showing two pages simultaneously
I am writing a language translation iPad app. The aim is to divide the screen in two horizontal sections. The upper section will display an article in English, while the lower section will display the ...