3.2.1 On Focus
Level A · added in WCAG 2.0
When any control receives focus, it must not trigger a change of context. A change of context is a major change, such as opening a new window, submitting a form, moving focus elsewhere or loading a new page.
Who it helps
Keyboard and screen reader users move focus through a page to explore it. If focus alone opens windows or jumps elsewhere, they get lost or cannot reach the rest of the page. People with cognitive disabilities and low vision are also confused by sudden changes.
How to meet it
- Trigger windows, dialogs, form submits and page loads only on activation, such as a click, Enter or Space, never on focus.
- Do not move focus to another element from a focus event handler.
- Know what is allowed: showing a tooltip, highlighting the field or expanding a small menu on focus is not a change of context.
- Tab through every page and check that nothing major happens until you press a key to activate something.
Examples
<label for="vat">VAT number</label>
<input id="vat" type="text" onfocus="window.open('/help/vat')"><form id="signup" action="/signup" method="post">
<label for="email">Email</label>
<input id="email" type="email" autocomplete="email">
<button onfocus="document.getElementById('signup').submit()">Sign up</button>
</form><label for="vat">VAT number</label>
<input id="vat" type="text" aria-describedby="vat-help">
<a id="vat-help" href="/help/vat">Where to find your VAT number</a><form action="/signup" method="post">
<label for="email">Email</label>
<input id="email" type="email" autocomplete="email">
<button type="submit">Sign up</button>
</form>Can a scanner detect this?
No
axe-core has no rule for this criterion, because it only shows up when focus moves at run time. A person must tab through the page and watch for windows, page loads, submits or focus jumps.
No automated rule tests this criterion. Check it by hand.
Common mistakes
- Opening a modal or chat window when a field receives focus.
- Moving focus to another field from an onfocus handler to steer users.
- Navigating to a page when a menu link is focused instead of activated.
Related criteria
Check your own page
See which automated WCAG checks your page fails, with the failing elements and how to fix them.
Reviewed November 2, 2026