Tab Focus Accessibility Problems

Each button has some text describing the issues with it.

The broken buttons/elements

Good and bad: This button is focusable, but other elements have broken tab order. This element alone would be good if the rest of the elements were fixed.




Bad: Div styled as button but not focusable

Element 2: Bad



Bad: breaks tab order with tabindex="2" (which makes it the first thing that's focusable), and link goes nowhere

Element 3: Bad


Bad: hidden/removed from tab order with tabindex="-1", so not focusable




Bad: span styled as an interactive element, but is not focusable/keyboard accessible.

Element 5: Bad


Element 6: Bad. inputs should have a "label" attached to them, but it is keyboard accessible.




Bad: custom button made with a div that's not keyboard accessible.

Element 7: Bad



Good buttons/elements




Element 9: Good, focusable link that's not broken



Key take-away

Stick to standard buttons/elements/inputs as much as possible.

If you make something custom with a div or a span, ensure you make it keyboard navigable.