Latest web development tutorials

HTML tabindex attribute

HTML Global Attributes HTML Global Attributes

Examples

Links with the specified tab key navigation order:

<a href="http://www.w3cschool.cc/" tabindex="2">W3CSchool</a><br />
<a href="http://www.google.com/" tabindex="1">Google</a><br />
<a href="http://www.microsoft.com/" tabindex="3">Microsoft</a>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the tabindex attribute


Definition and Usage

tabindex attribute specifies when using the "tab" key to navigate the element order.


Differences between HTML 4.01 and HTML5

In HTML5, tabindex attribute can be used with any HTML element (it will verify that any HTML element, but not necessarily useful).

In HTML 4.01, tabindex attribute can be used: <a>, <area>, <button>, <input>, <object>, <select>, and <textarea>.


grammar

<elementtabindex="number">

Property Value

描述
number 规定元素的 tab 键控制顺序(1 是第一)。


HTML Global Attributes HTML Global Attributes