Well, that seems to be a simple request, but I don't think so. I just want this to be the case when the html input [type = "text"] is focused (enabled in ios), all the text is selected (like any regular browser). I looked around and found a couple of suggestions, but nothing works - this is what I tried:
$('input[type="text"], textarea').focus(function() {
$(this).setSelectionRange(0, 9999);
}).mouseup(function(e){
e.preventDefault();
});
Also tried the following:
$('input[type="text"], textarea').focus(function() {
$(this).select();
}).mouseup(function(e){
e.preventDefault();
});
I read that the mouseup event on ios makes funky, but I'm not sure. Any ideas?
source
share