On Focus
"On focus" refers to the moment an interactive element on a web page, such as a text field, button, or link, receives focus, meaning it becomes the active element ready to accept keyboard input or interaction. This commonly happens when a user clicks an element, tabs to it with the keyboard, or when a screen reader moves to it. In accessibility contexts, what happens when an element receives focus matters because unexpected changes at that moment can disorient users.
"On focus" describes the point at which a user interface element gains focus, corresponding to the DOM 'focus' event exposed in HTML as the 'onfocus' event handler, a DOM Level 2 (2001) feature commonly used on form input elements. Focus can be received through pointer activation, keyboard navigation (for example, via the Tab key), or programmatically. In web accessibility practice, behavior triggered on focus is relevant to WCAG Success Criterion 3.2.1 On Focus (Level A, present since WCAG 2.0), which provides that receiving focus should not initiate an unexpected change of context; note that this evidence packet does not include the WCAG source text, so practitioners should consult the W3C's published WCAG documentation for the authoritative criterion wording. This entry is informational and not legal advice.
Why it matters
What happens the instant an element receives focus can determine whether a page is usable for people who navigate by keyboard or with a screen reader. Because focus can move as a user tabs through a page or as assistive technology advances through interactive elements, any behavior triggered at that moment affects every user who does not rely on a mouse. If receiving focus causes something unexpected to occur, users who cannot easily perceive or predict the change may become disoriented or lose their place.
This concern is reflected in WCAG Success Criterion 3.2.1 On Focus (Level A), which has been present since WCAG 2.0 and addresses the principle that receiving focus should not initiate an unexpected change of context. Because 3.2.1 is a Level A criterion, it sits at the most fundamental conformance tier, and behaviors that violate it can create significant barriers. Note that this evidence packet does not include the WCAG source text; practitioners should consult the W3C's published WCAG documentation for the authoritative wording of the criterion.
Designing and testing focus behavior is a matter of usability as much as conformance. Meeting a single success criterion does not guarantee an accessible experience overall, and automated tools detect only a portion of focus-related issues; manual keyboard testing and testing with assistive technology are generally needed to confirm that focus behaves predictably. This entry is informational and not legal advice.
Who it's relevant to
Inside On Focus
Common questions
Answers to the questions practitioners most commonly ask about On Focus.