You are here: Reference > HTML > attributes > tabIndex

tabIndex attribute

Browser support:
Specifies the tabbing order for keyboard navigation using the TAB key.
The default tabbing order matches the source order in the markup, with tabIndex you can change this order. The browser will tab to the elements in ascending order.

The another effect of the tabIndex attribute is that if it is specififed, the element can be active (can have focus). Most of the HTML elements cannot be active by default (div, span, ...), but if the tabIndex attribute is set on them, they can be active.

JavaScript page for this attribute: tabIndex. You can find other example(s) there.

Possible values:

Integer that sets the position of the element in the tabbing hierarchy. Default: 0. If the value is a negative number, the element will be removed from the tabbing hierarchy.
Default: 0.

Example HTML code 1:

This example illustrates the use of the tabIndex attribute:
<input type="text" tabindex="1" value="Use the" />
<input type="text" value="TAB key" />
<input type="text" tabindex="2" value="to navigate" />
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content