Focusable elements should have an interactive role
Experimental best-practice rule, not a WCAG requirement: when you put a div, span, paragraph or heading in the Tab order with tabindex, give it a role that says what it does, or use a native control.
Experimental
| Rule ID | focus-order-semantics |
|---|---|
| Impact | Minor |
| Success criterion | Best practice, not a WCAG requirement |
| Needs a change in the website’s code |
Example
<div class="filters">
<span class="chip" tabindex="0">Vegetarian</span>
</div>A screen reader says only “Vegetarian” on focus. The user cannot tell it is a filter they can switch on.
<div class="filters">
<button type="button" class="chip" aria-pressed="false">Vegetarian</button>
</div>A screen reader says “Vegetarian, toggle button, not pressed”, so the user knows to press Space.
Why it matters
Each time focus lands somewhere, a screen reader announces the element's name and its role: "Checkout, button", "Sizes, tab". The role tells a blind user what the thing is and which keys will work on it.
When an element without a role is added to the Tab order, the screen reader announces its text and nothing else. The user does not know whether it is a control, whether pressing Enter does anything, or why focus stopped there. Voice control users have a similar problem: commands such as "click button" ignore it.
For sighted keyboard users, focusable elements that do nothing are extra Tab stops that slow them down.
This rule is experimental, so its results can change as the check matures. Treat a failure as a prompt to review the element.
How to fix it
First decide what the element is for.
It is a control. Use the native element. A <button> or <a href> comes with focus, a role and keyboard support:
<button type="button" class="chip" aria-pressed="false">Vegetarian</button>
You must keep the custom element. Add the matching role, and the keyboard behaviour that role promises:
<span class="chip" tabindex="0" role="button" aria-pressed="false">Vegetarian</span>
A role="button" needs to react to both Enter and Space.
It is focusable so keyboard users can scroll it, such as a long code sample or a wide table wrapper. Make it a named region:
<div class="code-sample" tabindex="0" role="region" aria-label="Install script">
It only needs to receive focus from a script, for example a heading you move focus to after a form error. Use tabindex="-1", which keeps it out of the Tab order.
It does nothing. Remove the tabindex attribute.
Checklist
- Prefer button and a href for anything clickable.
- Give custom focusable elements a role that matches their behaviour.
- Name focusable scroll areas with role region and aria-label.
- Remove tabindex from elements that do nothing.
How the check works
The check looks at div, span, p and heading elements that have been put into the Tab order with a tabindex of 0 or more. It passes when the element has a widget role, such as button, link, tab or checkbox, or a role suited to a scrollable area, such as region, navigation or tooltip. This rule is experimental. Check manually that the role matches what the element actually does.
Resources
- Developing a keyboard interface W3C WAI
Updated October 27, 2026