Elements should not have a tabindex greater than zero

Use only tabindex="0" or tabindex="-1". A positive value moves an element ahead of everything else in the Tab order. This is a best practice; the same pattern is also checked against WCAG 2.4.3 Focus Order.

Rule IDtabindex
ImpactSerious
Success criterion Best practice, not a WCAG requirement
Readabler fix Needs a change in the website’s code

Example

Before
<footer>
  <form class="newsletter">
    <input type="email" aria-label="Email address" tabindex="1">
    <button tabindex="2">Subscribe</button>
  </form>
</footer>

The first Tab press jumps from the top of the page to the newsletter form in the footer.

After
<footer>
  <form class="newsletter">
    <input type="email" aria-label="Email address">
    <button>Subscribe</button>
  </form>
</footer>

Tab follows the page: menu, article, then the newsletter form at the end.

Why it matters

Keyboard users expect focus to move through a page in the order they read it: top to bottom, left to right in English. Any element with a positive tabindex breaks that. The browser visits all positive values first, in ascending order, and only then the rest of the page.

For a sighted keyboard user, focus suddenly jumps to the footer and back. People who zoom in or use a screen magnifier see only part of the page and lose track of where focus went. Screen reader users who tab through a form hear fields out of context.

Positive values are also hard to maintain. Each new element needs a number that fits between the others, and a single forgotten value elsewhere on the site reorders every page that includes it.

How to fix it

Remove positive values. In almost every case, deleting the attribute fixes the order:

<input type="email" aria-label="Email address">

Fix the source order instead. If elements receive focus in the wrong order without tabindex, change the order in the HTML so it matches the visual layout. Be careful with CSS that reorders content visually (order, flex-direction: row-reverse, grid placement), because focus still follows the HTML.

Custom controls. Use tabindex="0" to add a custom widget to the Tab order at its natural position:

<div role="slider" tabindex="0" aria-label="Price" aria-valuenow="40"></div>

Focus from a script only. Use tabindex="-1" on elements you move focus to with JavaScript, such as an error summary or a dialog heading.

You want a field focused first, like a search box on a search page: call focus() on load, or use the autofocus attribute sparingly, rather than changing the order of the whole page.

Checklist

  1. Remove every tabindex value above 0.
  2. Match the HTML order to the visual order.
  3. Use tabindex="0" for custom widgets.
  4. Use tabindex="-1" for script-only focus targets.

How the check works

The check looks at every element with a tabindex attribute. It passes when the value is 0, negative or not a number, and fails when it is greater than 0. It cannot judge whether the remaining focus order matches the visual reading order: tab through the page by hand to confirm.

Resources

Updated October 27, 2026