how can i autofocus a text input on page load or is it impossible?

There's a page (simply a html) in my web application, which has a text input. What I need is to focus on the input on page load so that when I view the page on mobile phones, the keyboard rises automatically.

I tried the autofocus attribute and javascript like $("input").focus(). Everything went well on Android phones. But when it comes to iphone (I tried iphone 5S and iphone 6), neither worked.

I googled this problem, only found that this may be a feature that iOS prevents focus event which does not originate from user interaction.

So my question is, is it possible to do so? If yes, please show the solution, thank you very much.

iPhone 6, iOS 8.3

Posted on Jul 2, 2015 1:30 AM

Reply

There are no replies.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

how can i autofocus a text input on page load or is it impossible?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.