happily

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
几乎所有浏览器均 支持tabindex 属性,除了 Safari

今天有缘让我了解到tabindex在Safari的执行状态, 虽然这是美国同事给我提的一个bug,但是在今后的工作中还是应该注意和提前避免以下。
Tabindex
带有指定 tab 键顺序的链接.
浏览器支持
几乎所有浏览器均 支持tabindex 属性,除了 Safari。
定义和用法
tabindex 属性规定元素的 tab 键控制次序(当 tab 键用于导航时)。
提示和注释
注 释:以下元素支持 tabindex 属性:<a>, <area>, <button>, <input>, <object>, <select> 以及 <textarea>。
那么Safari到底支持哪些呢?  

下面是来自http://my.safaribooksonline.com/book/programming/mobile/1565929470/wml-user-interaction/ch04-27313
4.10. The tabindex Attribute

Some browsers can cycle through <input> and <select> in a card using some sort of TAB key or similar control. Normally, the order in which this happens is chosen by the browser (usually the order in which the elements are specified in the card). The tabindex attribute allows this order to be changed for some or all of the elements in a card.

Not all browsers support this feature, as it doesn't fit into all of the user interfaces. If this feature is supported, the browser sorts all the<input> and <select> elements with a tabindex specified in ascending order. Pressing the TAB key (or whatever normally cycles through such elements) then selects these elements in this order. Any elements in the card without a tabindex specified are selected last.

。。。。

它仅仅支持<input> and <select>,
因此在我们的页面中把所有button的样式都改成<input>,不要用<a>标签代替,否则tab键永远不能跳到“提交”按钮上。切记!

posted on 2013-04-27 12:29  happily  阅读(719)  评论(0编辑  收藏  举报