I have an html web app and I want the keyboard to open when I load my page, I've tried:
<textarea class="form-control" autofocus="autofocus"></textarea>
but all that does is focus the textarea and makes it show up once I touch the page, rather then just automatically on page load.
I heard that it was impossible to do this without some type of user interaction in JavaScript alone. If this is true, are there any plugins out there that might do this?
Hope this makes sense, thanks!
Unfortunately, autofocus isn't supported by mobile Safari due to usability reasons. I've seen people try different work arounds, including simulating a click/focus on the element in question. I've never been able to get it to work though, on mobile Safari at least.
$(function(){
$('#my-textarea').focus().click();
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With