Tabindex
Difficulty: Advanced
Category:
- Structure
Tabindex values of 1 or greater assign a specific tab order to elements. Because the default tab order of the page is typically logical and intuitive, positive values are rarely necessary. A tabindex value of 0 allows elements other than links or form elements to be focusable in the default tab order of the document. Tabindex of -1 allow other elements to receive focus, but only when focus is set through JavaScript or via a link. Setting and modifying tabindex values and controlling keyboard focus with JavaScript can greatly increase the accessibility of dynamic and interactive web applications and widgets.