4.1.2 Name, Role, Value
Level A Since WCAG 2.0 How it is checked: Automated checker
In plain language
Every button, input, menu, tab… must have a name, role and state that screen readers can announce (e.g. "Menu button, collapsed").
Who is affected
- Blind people using screen readers
- People with motor disabilities using only a keyboard
Examples
Fails
<div class="menu-btn" onclick="openMenu()">☰</div>
<span class="tab active">News</span>Passes
<button aria-expanded="false" aria-controls="menu">Menu</button>
<button role="tab" aria-selected="true">News</button>How to fix
- Prefer native HTML elements; for custom components add a role, a name and aria-* state attributes.
- Update aria-expanded, aria-selected, aria-checked when the state changes.
- Embedded frames (iframe) need a title attribute.
How to test it yourself
- Use a screen reader to move through the interactive components: do you hear the name, type and state of each one?
What WCAG.win checks
WCAG.win checks part of this criterion automatically. The rest still needs a person.
- Automated checker – rule
area-alt: Active <area> elements must have alternative text - Automated checker – rule
aria-allowed-attr: Elements must only use supported ARIA attributes - Automated checker – rule
aria-braille-equivalent: aria-braille attributes must have a non-braille equivalent - Automated checker – rule
aria-command-name: ARIA commands must have an accessible name - Automated checker – rule
aria-conditional-attr: ARIA attributes must be used as specified for the element's role - Automated checker – rule
aria-deprecated-role: Deprecated ARIA roles must not be used - Automated checker – rule
aria-hidden-body: aria-hidden="true" must not be present on the document body - Automated checker – rule
aria-hidden-focus: ARIA hidden element must not be focusable or contain focusable elements - Automated checker – rule
aria-input-field-name: ARIA input fields must have an accessible name - Automated checker – rule
aria-prohibited-attr: Elements must only use permitted ARIA attributes - Automated checker – rule
aria-required-attr: Required ARIA attributes must be provided - Automated checker – rule
aria-roledescription: aria-roledescription must be on elements with a semantic role - Automated checker – rule
aria-roles: ARIA roles used must conform to valid values - Automated checker – rule
aria-tab-name: ARIA tab nodes must have an accessible name - Automated checker – rule
aria-toggle-field-name: ARIA toggle fields must have an accessible name - Automated checker – rule
aria-tooltip-name: ARIA tooltip nodes must have an accessible name - Automated checker – rule
aria-valid-attr-value: ARIA attributes must conform to valid values - Automated checker – rule
aria-valid-attr: ARIA attributes must conform to valid names - Automated checker – rule
button-name: Buttons must have discernible text - Automated checker – rule
duplicate-id-aria: IDs used in ARIA and labels must be unique - Automated checker – rule
frame-title-unique: Frames must have a unique title attribute - Automated checker – rule
frame-title: Frames must have an accessible name - Automated checker – rule
input-button-name: Input buttons must have discernible text - Automated checker – rule
input-image-alt: Image buttons must have alternative text - Automated checker – rule
label: Form elements must have labels - Automated checker – rule
link-name: Links must have discernible text - Automated checker – rule
nested-interactive: Interactive controls must not be nested - Automated checker – rule
select-name: Select element must have an accessible name - Automated checker – rule
summary-name: Summary elements must have discernible text
W3C documentation: Understanding Success Criterion 4.1.2: Name, Role, Value