Skip to main content
HTML Validation

The “aria-label” attribute must not be specified on any “b” element unless the element has a “role” value other than “caption”, “code”, “deletion”, “emphasis”, “generic”, “insertion”, “paragraph”, “presentation”, “strong”, “subscript”, or “superscript”.

About This HTML Issue

A <b> element without an explicit role has the generic role, and generic elements can't have an accessible name, so aria-label is not allowed on it.

ARIA forbids naming elements with the roles listed in the message. Screen readers often skip an aria-label on these elements, and users never hear it. Setting role="generic" or role="presentation" on the <b> doesn't help either, because both roles are in the list.

The usual cause is a <b> used as a clickable icon, such as the "×" that closes a notice. Keyboard users can't tab to a <b>, and screen readers don't announce it as a button. Replace it with <button type="button">, which takes aria-label, receives focus, and runs its click handler when the user presses Enter or Space.

Adding aria-hidden="true" doesn't clear the message. The validator still flags the aria-label, and nobody hears the label of a hidden element anyway. For a purely decorative <b>, keep aria-hidden="true" and delete aria-label. If the <b> is a symbol that means something by itself, like an asterisk that marks a required field, role="img" makes the label valid. For ordinary bold text, remove aria-label and reword the visible text if it isn't clear enough on its own.

Invalid example

<div class="alert" role="status">
  <p>Your changes have been saved.</p>
  <b class="alert-close" aria-label="Dismiss message" onclick="this.parentElement.hidden = true">&times;</b>
</div>

Valid example

<div class="alert" role="status">
  <p>Your changes have been saved.</p>
  <button type="button" class="alert-close" aria-label="Dismiss message" onclick="this.parentElement.hidden = true">&times;</button>
</div>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries