Tabindex attribute

From Level Access Web Labs
Jump to: navigation, search

This heading has a tabindex of -1

This div has a tabindex of 0
Div with tabindex
This is a div

Note: Tabindex 0 and -1 are useful for making elements capable of receiving focus that are not natively capable, such as: headings, div, span and so on.

tabindex="0"
Used to make an element focusable and adds it to the focus order (tab order) in the order the element appears in the DOM.
ref: http://www.w3.org/TR/WCAG20-TECHS/C27.html
tabindex="-1"
Used to make an element focusable but does not add it to the tab order of the page.