[英]How to focus on specific non-form element in safari?
Is it possible to use javascript to focus anywhere but the URL if the focus is on the single form element on the page and the use presses Tab ? 如果焦点位于页面上的单个表单元素上并且用户按下Tab键,是否可以使用javascript将焦点放在URL以外的任何位置? There's a setting "press tab to highlight each item on a webpage", which does allow to do exactly that by default, but is there a way to force such behavior without that setting?
有一个设置“按选项卡突出显示网页上的每个项目”,默认情况下确实允许这样做,但是如果没有该设置,有没有办法强制这种行为呢?
You just need to set the tabindex
property on any element to make it focusable. 您只需要在任何元素上设置
tabindex
属性即可使其具有焦点。
https://developer.mozilla.org/en-US/docs/DOM/element.tabIndex https://developer.mozilla.org/zh-CN/docs/DOM/element.tabIndex
http://snook.ca/archives/accessibility_and_usability/elements_focusable_with_tabindex http://snook.ca/archives/accessibility_and_usability/elements_focusable_with_tabindex
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.