- Level
- A
- Since
- WCAG 2.0
- Entries
- 129 / 193
4.1.2 Name, Role, Value
Every control needs a name and a role in the markup, or assistive technology cannot say what it is.
/ What it requires
Assistive technology does not look at the screen. It asks the browser what each control is called, what kind of control it is and what state it is in. This criterion requires all three to be available in code for every user interface component: a name, a role, and any state or value the user can change, with changes reported as they happen. Without them a screen reader says "button" and nothing more, or says nothing at all, and voice control cannot address the control.
Native HTML controls used as specified meet this without extra work: a button element with text, an input with a label, a link with content. The criterion bites on what authors build themselves, such as a div that reacts to clicks, a custom dropdown or an accordion. Those need a role, an accessible name, and state attributes such as aria-expanded or aria-checked that script keeps up to date. It names no exceptions. A control that works with a mouse and is missing from the accessibility tree fails.
/ How pages fail it
- A button contains only an icon and has no text, no aria-label and no title.
- A div or a span with a click handler acts as a button and has no role.
- A text field has no label element, no aria-label and no aria-labelledby.
- An accordion or a menu button opens and closes without ever changing aria-expanded.
- An aria-labelledby attribute names an id that does not exist on the page, so the computed name is empty.
/ How to check it yourself
- Tab through the page with a free screen reader such as NVDA running. At every stop you should hear a name, a role and, where it applies, a state.
- Inspect each control in the Accessibility pane of the browser developer tools and read its Name, its Role and its state properties.
- Operate every custom widget: open the accordion, flip the toggle, pick an option. Check that the state shown in the accessibility tree changes with it.
- Run a free browser extension such as axe DevTools or WAVE to list controls with no name, then confirm its findings by hand.
- Search the source for aria-labelledby, aria-describedby and aria-controls and confirm that every id they mention exists.
/ How to fix it
- Use the native element first: button for actions, a with href for navigation, and input, select and textarea for data.
- Name icon buttons with aria-label or with visually hidden text inside the button, and give every iframe a title attribute.
- Connect each field to a label element through for and id, or use aria-labelledby where a visible text already serves as its label.
- On custom widgets, set the role and keep aria-expanded, aria-checked or aria-selected in step with what the widget shows, from the same script that changes it.
- Do not put aria-hidden="true" on anything that contains focusable elements, and give an open dialog aria-modal="true" and a name.
/ What our scanner checks
The static pass counts fields with no aria-label, aria-labelledby, title or matching label for. In the rendered page our rules report empty accessible names, ARIA references to missing ids, focusable content under aria-hidden, untitled iframes, and dialogs, comboboxes and accordions lacking state attributes. axe and HTML_CodeSniffer add unnamed buttons, links and fields and invalid ARIA values. Nothing operates a widget, so state changes go untested.
/ Who fails it, in our own measurements
One page per body, measured by automated checks on a weekly schedule. Any body that has fixed something since the last sweep will show it at the next one, and every entity page carries a right of reply.
/ Questions about this criterion
What is an accessible name?
It is the text a browser exposes to assistive technology as the name of an element. The browser computes it in a fixed order: aria-labelledby first, then aria-label, then the native source such as a label element, the alt attribute or the text inside a button or link, and last the title attribute. A screen reader announces it together with the role, as in "Search, button".
Do I need ARIA to meet Name, Role, Value?
Often not. Native HTML elements already carry a role, take their name from their content or label, and report their own state. ARIA is needed when you build a control that HTML does not offer, or when a native control has no visible text to name it. ARIA on an element that does not behave like the role it claims makes things worse.
Why does a screen reader only say "button" on my page?
Because the button has a role and no accessible name. The usual cause is an icon button: an svg or a background image inside a button element with no text. Add an aria-label that says what the button does, or put visually hidden text inside it. If the icon is an img element, give it alt text, which then names the button.
