Barrierepruefung.de Web Accessibility Checker

WCAG 4.1.2 Name, Role, Value: explained simply

Every control must tell assistive technology such as screen readers its name, its role and its current state. When the state changes, for example when a menu opens, that change must be passed on too. Native HTML controls do this by themselves when used as specified; custom widgets need extra markup.

Last reviewed: Sources

What does the criterion require?

A screen reader does not see the design. It learns about a page through the browser's accessibility interface and speaks what it finds there. To announce a control correctly and let the user operate it, each control has to expose three things:

  • Name: what it is called, such as "Search" or "Menu"
  • Role: what kind of thing it is, such as a button, link, checkbox or tab
  • State and value: what state it is in, such as expanded, selected or checked, and what value it has, such as the position of a slider

Whatever a user can set on a control must also be settable through that interface, and any change has to be reported back. Otherwise a menu opens on screen and stays closed for the screen reader. This applies to every user interface component: form fields, links and components generated by script.

The criterion is aimed mainly at people who build their own components. Native HTML elements such as button, a with an href, input and select already expose name, role and state when used the way the specification intends. Anyone building a control from scratch has to supply that information themselves, usually with WAI-ARIA roles, states and properties.

It matters to everyone who reaches a site through assistive technology: screen reader users, screen magnifier users, and speech recognition users, who address a control by its name.

Two neighbours are worth knowing. Info and Relationships asks for the structure of the content to be in the code, and Link Purpose (In Context) goes one step further for links: having a name is not enough, the name has to make the destination clear.

Common failures

  • A div or span turned into a button. Script makes it clickable, but it never gets a role. The screen reader reads the text and gives no hint that it can be activated (F59).
  • A control without a name. An icon-only button, or a link whose only content is an image with no text alternative (F68, F89).
  • A visible label with no accessible name. "Email" sits next to the field, but nothing ties the two together (F111).
  • A state that changes only on screen. An accordion opens, a tab becomes active, a switch flips, and the markup stays as it was. The same goes for a focus state the interface never learns about (F79).
  • One name for a multi-part field. A phone number split across three inputs, with a label on the first one only (F86).
  • A text alternative that does not follow the image. An icon switches between "play" and "pause", its alt text does not (F20).
  • Emulated links. An element that behaves like a link through script but is not one (F42).

Checked automatically and checked by you

What the automated check detects

Coverage: extensive

The automated check covers most of this criterion, but not every case.

Name, role and state are checked where they appear in the markup. Custom controls without any markup go unnoticed.

Rules

  • Buttons must have discernible text button-name
  • Link without a discernible name link-name
  • Input buttons must have discernible text input-button-name
  • Select element must have an accessible name select-name
  • ARIA attributes must conform to valid values aria-valid-attr-value
  • aria-required-attr
  • aria-roles
  • Interactive controls must not be nested nested-interactive

What you check yourself

You answer this question in the manual checks of your scan.

Do custom-built controls pass name, role and state to assistive technology?

  1. On several pages of different kinds, look for controls that are not standard HTML elements but custom-built: expandable menus and accordions, tabs, custom select lists, switches, sliders, clickable areas. Standard elements such as links, buttons and form fields meet the requirement by themselves when used according to specification. The automatic check measures what the source says about name, role and state; it does not detect custom controls without any markup. If the website has standard elements only, choose "met".
  2. Right-click a custom-built element, choose "Inspect" (in some browsers "Inspect Element") and open the "Accessibility" view in the developer tools. It must show a name that says what the element does, and a role that fits its function, such as button, link, checkbox, tab or combobox. If the name is missing or no fitting role is shown, that is a defect.
  3. Operate the element and watch the same view: state and value must be shown there and change as you operate it, such as expanded, selected, checked, pressed or the value of a slider. If something changes visibly but nothing changes in this view, that is a defect.
  4. A test with a free screen reader (NVDA on Windows, VoiceOver on Mac) is more reliable: it must announce name and role when it reaches the element, the element must be operable with it, and the change must be announced, such as "menu, button, expanded". If you can carry out neither of the two tests, choose "I cannot judge this".

Classification

Level
A
Introduced in
WCAG 2.0
W3C explanation
Understanding 4.1.2