div 上的 tabindex 在 IE8 中不起作用

发布于 2024-11-19 03:27:49 字数 410 浏览 3 评论 0原文

我问了这个问题关于如何使像 div 元素这样的元素获得焦点,那里的答案确实对我有很大帮助。但我无法让 IE8 理解它。我不知道这里出了什么问题。我的方法是在我的 div 元素上使用 tabindex='x' ,然后通过 jQuery,使用 $('#divId').focus 设置焦点()。这在所有浏览器中都可以正常工作,但在 IE8 中无法响应(没有错误,只是不起作用)。

有人有什么想法吗? 谢谢

I asked this question about how to make elements like div element get focus, and the answer there really helped me a lot. But I can't make IE8 understand about it. I don't know what's wrong here. My method is to use tabindex='x' on my div element and then through jQuery, set in under focus using $('#divId').focus(). This works like a charm in ALL browsers, but fails to respond in IE8 (no bug, just doesn't work).

Anyone has any idea?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文