如何忽略tabindex中的HTML元素? [英] How to ignore HTML element from tabindex?

查看:102
本文介绍了如何忽略tabindex中的HTML元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么方法可以告诉浏览器不要在特定元素上使用tab索引?

在我的页面上,虽然有一个使用jQuery呈现的sideshow ,当您选中时,您会在选项卡控件移动到页面上的下一个可见链接之前获得大量的选项卡按钮,因为所有标签页都以可视方式隐藏给用户。

解决方案

您可以使用 tabindex = -1



W3C HTML5规范支持负值 tabindex 值:
$ b


如果值为负整数

用户代理必须设置元素的tabindex焦点标记,但不应允许使用顺序焦点导航到达元素。







请注意,这是HTML5功能,可能无法在旧版浏览器中使用。

W3C HTML 4.01标准(从1999年开始)合规,tabindex需要积极。


Is there any way in HTML to tell the browser not to allow tab indexing on particular elements?

On my page though there is a sideshow which is rendered with jQuery, when you tab through that, you get a lot of tab presses before the tab control moves to the next visible link on the page as all the things being tabbed through are hidden to the user visually.

解决方案

You can use tabindex="-1".

The W3C HTML5 specification supports negative tabindex values:

If the value is a negative integer
The user agent must set the element's tabindex focus flag, but should not allow the element to be reached using sequential focus navigation.


Watch out though that this is a HTML5 feature and might not work with old browsers.
To be W3C HTML 4.01 standard (from 1999) compliant, tabindex would need to be positive.

这篇关于如何忽略tabindex中的HTML元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆