Tab order set by tabindex

How the scan finds tabindex values above 0, why even one is a fail, and how to let the page order set the tab order.

What AuditX checks

The scan reads the HTML of the page you scanned and finds every element that has a tabindex attribute. The HTML is the browser-rendered version when the page needed rendering and the render gave more content, and the raw HTML otherwise. It reads the number in each attribute. The check fails when at least one element has a whole number greater than 0, and it passes when none does. One is enough to fail. The message counts the elements and names up to 5, by tag, id and first class, or by tag and the first words of its text. The count raises the weight of the failure. Values of 0 and -1 are fine and are ignored, as are values that are not numbers. It does not need a browser and runs on the HTML alone. It does not test the real tab order, so it cannot tell whether a positive value actually puts the order out of step with the page, and an element added by a script after load is only seen if the rendered HTML was used. A fail costs points, and a pass costs none.

Why it matters

MDN recommends using only 0 and -1 as tabindex values and warns against values greater than 0, because they make it difficult for people who rely on a keyboard or assistive technology to navigate and operate the page.

W3C WCAG 2.4.3 (Focus Order) says that when people move through content with a keyboard, the order should be consistent with the meaning of the content. A positive tabindex jumps an element to the front of the natural order, as web.dev explains, which can break that.

How to fix it

  1. Remove every tabindex value above 0 from your templates, plugins and widgets.
  2. Reorder the HTML itself so the order in the source matches the order a visitor reads the page.
  3. Use tabindex="0" only to make a custom control reachable by keyboard, and tabindex="-1" for elements you focus with a script.
  4. Tab through the page with your keyboard afterwards, to check that focus moves in a sensible order.
<button type="button">First</button>
<button type="button">Second</button>

Does your site pass this check? A free scan runs it with every other check and shows the result in about a minute.

Scan my site

Sources

Related checks

Last reviewed 2026-11-13.