Ok, this seems to be a simple request, but I am not finding it to be so. I just want it so when an html input[type=”text”] is focused (tapped in ios), all text is selected (like any normal browser). I have looked around and found a couple suggestions, but nothing seems to work – here is what I have tried:
$('input[type="text"], textarea').focus(function() {
$(this).setSelectionRange(0, 9999);
}).mouseup(function(e){
e.preventDefault();
});
Also tried this:
$('input[type="text"], textarea').focus(function() {
$(this).select();
}).mouseup(function(e){
e.preventDefault();
});
I have read that the mouseup event on ios does funky stuff, but I am not sure. Any ideas?
I believe it should be