javascript - HTML5 自动对焦在 Firefox 中不起作用

标签 javascript angularjs html firefox autofocus

<分区>

我正在使用 Angular JS 和 HTML5 应用程序。我有一个带有用户名和密码字段的登录表单。当登录页面加载时,我希望默认情况下焦点位于用户名上。我使用 HTML5 autofocus="autofocus" 来实现这一点,而无需编写任何脚本。

 <input name="USER" id="USER" type="email" class="input-control" data-ng-model="login.userName" required autofocus="autofocus">

这在 Google Chrome、Internet Explorer 和 Safari 中运行良好。然而,自动对焦在 Mozilla Firefox 中不起作用。我对旧版本的 Firefox 中自动对焦的一些问题感到愤怒。我使用的是 48.0

版本

有什么解决办法吗?提前致谢

最佳答案

关于javascript - HTML5 自动对焦在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40862947/

相关文章:

javascript - 使用 JavaScript 搜索元素

javascript - 启动重新初始化 jquery 脚本后 Angular 停止工作

javascript - 带过滤器的 Angular 自动完成:search

html - Chrome 中的字体不显示

html - 具有特定同级的 css 选择器

javascript - 调整窗口滚动速度

javascript - 未捕获的脚本错误 : Invalid argument: EVENT_HANGOUT

javascript - Node.js 中的 sqlite3 不从 INSERT 回调返回 lastID

AngularJS : returning data from service to controller

javascript - 当某些情况出现时显示警报错误消息