ipad - 在 ipad html5 站点中使用键盘自动对焦

标签 ipad html

我正在开发一个 html5 应用程序,它将在 iPad 上以自助服务终端模式使用。用户必须做的第一件事是登录,因此当主页加载时,我希望屏幕键盘弹出,焦点位于第一个字段。

我已经尝试了所有我能想到的变体,包括

  • html5 <input autofocus> 属性
  • 在窗口加载时调用 document.getElementById("nameFirst").focus()
  • 同上,只是onload调用了timer方法,稍后调用focus

有没有人想出如何让键盘自动出现?

最佳答案

移动版 Safari 不允许在用户不触摸文本输入元素的情况下显示键盘。我认为这是设计使然。

http://www.quora.com/Mobile-Safari-iPhone-or-iPad-with-Javascript-how-can-I-launch-the-on-screen-keyboard

关于ipad - 在 ipad html5 站点中使用键盘自动对焦,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3714084/

相关文章:

javascript - Bootstrap DOM 属性 - getElementById 或 $ ("")?

php - html 表并用带有空行的 php 填充

html - CSS - 使用标签实现边框图像

php - 如何创建 Left Tabber 内容

html - 如何在其父 div 的中心对齐绝对位置子元素

iphone - 防止从 iCloud 中的应用程序备份

iphone - iPhone 4 上的 GPS 准确度如何?

javascript - $(window).resize 是做什么的?移动版

iphone - 在UITableViewView中异步下载多个图像?

iphone - 收到内存警告。等级=1