Skip to main content
Raasta
SeriousBest practicetabindex

Positive tabindex changes the tab order

tabindex="1" or higher forces an element to the front of the keyboard order, so focus jumps around the page. Use tabindex="0" or nothing, and order the HTML the way people read it.

Who it hurts

Keyboard users and screen reader users.

Usually added to “help” a search box or form. It breaks the order everywhere else.

How to fix it

Pick your stack. Review every change before you ship it.

Before

<input type="search" tabindex="1">

After

<input type="search">

Check it by hand too

Tab through the whole page. Focus should follow the reading order without jumping back.

Automated checks find a large share of accessibility problems, but not all of them. Passing this check does not on its own make a page compliant.