目录 搜索
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
文字

tabindex全局属性指示是否它的元件可以被聚焦,并且如果/它在顺序键盘导航参与(通常使用Tab键,因此而得名)。它接受一个整数作为一个值,不同的结果取决于整数的值:

  • 负值(通常tabindex="-1")意味着元素应该是可聚焦的,但不应该是通过顺序键盘导航可达。对于使用JavaScript创建可访问的小部件非常有用。

  • tabindex="0" 意味着该元素应该在顺序键盘导航中可以聚焦,但其顺序由文档的源顺序定义。

  • 正值意味着元素应该是在顺序键盘导航可聚焦的,以其顺序由数的值来定义。也就是说,tabindex="4"之前会集中tabindex="5",但之后tabindex="3"。如果多个元素共享相同的正值tabindex,则它们相对于彼此的顺序将遵循其在文档源中的位置。

与元素tabindex="0",一个无效的值,或者没有tabindex属性应该具有正元素之后被聚焦tabindex在顺序键盘导航顺序的值。

如果我们将tabindex属性设置为<div>,那么它的子内容不能用箭头键滚动,除非我们也设置tabindex内容。

注:最大值为tabindex32767.如果未指定,则采用默认值-1。

规格

规范

状态

评论

HTML生活标准该规范中'tabindex'的定义。

生活水平

最新的快照,HTML 5.1没有变化

HTML 5.1该规范中'tabindex'的定义。

建议

HTML Living Standard的快照,HTML5没有改变

HTML5该规范中'tabindex'的定义。

建议

HTML生活标准快照。从HTML 4.01规范中,该属性现在支持所有元素(全局属性)。

HTML 4.01规范该规范中'tabindex'的定义。

建议

仅支持<a>,<area>,<button>,<object>,<select>和<textarea>。

浏览器兼容性

Feature

Chrome

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

Feature

Android

Chrome for Android

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

(Yes)

上一篇: 下一篇: