Level ARobust
4.1.2

Name, Role, Value

Every control must tell assistive tech three things in code: what it is (role), what it's called (name), and its current state (value).

In plain English

Assistive technologies do not see your buttons and menus, they read the code behind them. For each control, they need three facts: its role (is this a button, a checkbox, a tab?), its name (what is it called?), and its value or state (is it checked, expanded, selected?). If any of those is missing, a screen reader either says nothing or says the wrong thing, and the control becomes unusable.

This is the criterion that custom, JavaScript-built widgets fail most, because a <div> styled to look like a button has no role, no name, and no state unless you add them.

Who this is for

  • Screen-reader users, who rely entirely on the exposed name, role, and state to understand and operate controls.
  • Users of other assistive tech (voice control, switch access), which also depend on these programmatic properties.

What “good” looks like

Use native elements, or add the full ARIA picture to custom ones.

<!-- Good: native, exposes name + role + state automatically -->
<button aria-pressed="true">Add to wishlist</button>

<!-- Good: custom widget with role, name, and state -->
<div role="checkbox" aria-checked="false" tabindex="0"
     aria-labelledby="terms-label">…</div>
<span id="terms-label">I agree to the terms</span>

<!-- Bad: a div that looks like a control but exposes nothing -->
<div class="checkbox"></div>

Where stores get it wrong

Custom dropdowns, toggles, tabs, and star-rating widgets built from bare <div>s with no role or name, and toggle buttons that never update their state. Automated scanners catch only some of this, which is why manual review matters. These are frequent entries on the common failures list.

How to meet it

Techniques the W3C accepts as sufficient (summarized). Follow a link for the full method.

Common mistakes

Patterns the W3C lists as failures of this criterion. Avoid these.

Frequently asked questions

What does name, role, value mean in WCAG?+

Success Criterion 4.1.2 (Level A) says every user-interface component must expose, in code, its name (what it's called), its role (what kind of control it is, a button, checkbox, etc.), and its value or state (checked, expanded, selected). Assistive tech reads these to describe and operate the control.

Why do custom widgets fail this so often?+

Custom controls built from generic <div> or <span> elements have no role, no name, and no state unless you add ARIA. A screen reader then announces nothing useful, so the control is unusable. Native HTML elements provide all three automatically.

How do I fix a custom control?+

First, prefer a native element (button, input, select) which gets name/role/value for free. If you must build a custom widget, give it the correct ARIA role, an accessible name (aria-label or aria-labelledby), and keep its state updated (aria-checked, aria-expanded, and so on).

Reference

This is a plain-language explainer. The authoritative source is the W3C Web Content Accessibility Guidelines (WCAG) 2.2.

WCAG 2.2 © W3C. Excerpts are paraphrased; see the linked documents for the normative text.

Not sure if your store passes 4.1.2?

A human auditor checks this and every other criterion against your live store, and documents the result.

Book an audit