Skip to main content

What is a tabindex?

Information about the article

Portrait of Dmitry Dugarev

Author: Dmitry Dugarev

Consultant for digital accessibility & IT compliance

Last updated on:

The tabindex is an HTML attribute that controls the tabbing order of interactive elements on a webpage. It allows developers to set the order in which elements receive focus when the user uses the Tab key [1].

Some important values for the tabindex attribute are:

  • tabindex="0": The element is focusable and is included in the natural tabbing order of the page.
  • tabindex="-1": The element is focusable but is not included in the tabbing order. It can only be focused programmatically.
  • tabindex="positive Zahl": The element is focusable and is considered in the tabbing order before elements with tabindex="0". The order is determined by the magnitude of the number (lower numbers first).

Using the tabindex attribute is important for website accessibility, as it ensures that users who rely on keyboard navigation have a logical and predictable order when navigating through interactive elements.

Further information about the tabindex attribute can be found in the official documentation [1].

​

  1. WHATWG, “HTML Standard — The tabindex attribute.” 2024. [Online]. Available: https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex ⤴

About the author

Portrait of Dmitry Dugarev

Best regards,

Dmitry Dugarev

Founder of Barrierenlos℠. I test websites by hand and fix the barriers on WordPress websites – without a relaunch.