WCAGdesk
axe-core: aria-required-attr · WCAG 4.1.2 Name, Role, Value · Level A

How to fix the “aria-required-attr” accessibility issue

The axe-core aria-required-attr rule fails when an element with an ARIA role is missing an attribute that role requires — for example role="checkbox" without aria-checked. The control then exposes an incomplete state. WCAG 2.2 (4.1.2, Level A).

What axe-core checks

axe-core checks each ARIA role against its required attributes and fails any element missing one (e.g. role="slider" without aria-valuenow).

Which standard this maps to

WCAG 2.24.1.2 Name, Role, Value (Level A)
EN 301 5499.4.1.2
BFSG / EAABFSG § 12 via EN 301 549 · EAA Annex I
CategoryARIA

Why it matters

Custom widgets (toggles, star ratings, tabs) built with ARIA roles but missing their required state attributes confuse assistive tech — the user cannot tell if a toggle is on or off. The fix is usually safer to avoid by using native HTML.

Common causes

  • role="checkbox" without aria-checked
  • role="slider" without aria-valuenow
  • role="combobox" missing aria-expanded
  • Hand-rolled widgets copying a role without its state attributes

How to fix it

Add the required attributes for the role and keep them updated in JavaScript — or, better, use the native HTML element (e.g. <input type="checkbox">) which provides them for free.

<!-- Fails -->
<div role="checkbox">Subscribe</div>

<!-- Passes (native is best) -->
<input type="checkbox" id="sub"><label for="sub">Subscribe</label>

FAQ

Which attributes are required?

It depends on the role; consult the ARIA spec. axe names the missing one in its report.

Native or ARIA?

Prefer native HTML. ARIA roles add responsibility — you must manage all required states and keyboard behaviour yourself.

Find every issue like this on your site

Run a free WCAG 2.2 AA scan — real axe-core engine, no signup. Or get a timestamped evidence report for €29.