Linked Questions

5 votes
4 answers
23k views

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 ...
Anand's user avatar
  • 4,561
724 votes
30 answers
745k views

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 ...
Questions's user avatar
  • 21.1k
85 votes
9 answers
82k views

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")...
user140550's user avatar
59 votes
6 answers
96k views

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 ...
boymc's user avatar
  • 1,257
18 votes
7 answers
9k views

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 ...
Keale's user avatar
  • 4,013
6 votes
3 answers
5k views

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 ...
EFC's user avatar
  • 1,949
6 votes
6 answers
6k views

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. ...
DreamTeK's user avatar
  • 34.6k
10 votes
2 answers
3k views

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 ...
Ariel Vardi's user avatar
8 votes
1 answer
7k views

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 ...
TtT23's user avatar
  • 7,080
0 votes
1 answer
2k views

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 ...
chuckscoggins's user avatar
2 votes
0 answers
3k views

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 ...
Matt's user avatar
  • 2,841
1 vote
1 answer
744 views

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 ...
CODE-REaD's user avatar
  • 3,118
0 votes
1 answer
555 views

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(); ...
Aerodynamika's user avatar
  • 8,614
2 votes
0 answers
678 views

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 ...
CookieEater's user avatar
  • 2,524
0 votes
1 answer
124 views

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 ...
Amarsh's user avatar
  • 11.9k