Skip to main content

Axe Core Guide

Free site validation

Find out what web pages on your sites are affected by HTML issues.

Axe Core 4.9

Elements must have their visible text as part of their accessible name

The visible label of interactive items labeled through their content must be included in their accessible name.

This rule applies to any element with the following attributes:

  • a semantic role that is a widget that supports name from content,
  • visible text, and
  • an aria-label or aria-labelledby attribute.

button, checkbox, gridcell, link, menuitem, menuitemcheckbox, menuitemradio, option, radio, searchbox, switch, tab, and treeitem are widget roles that support name from content.

The whole visible text content of the target element either matches its accessible name or is contained within it.

Leading and trailing whitespace and case sensitivity differences should be disregarded.

Users using speech input can interact with a web page by saying the visible text labels of menus, links, and buttons.

Voice input users are confused when they utter a visible text label, but the speech command does not work since the accessible (programmatic) name of the component does not match the visible label. When a user interface component contains a visible text label — whether the label is actual text or a picture of text — that text must also appear in the component’s accessible (programmatic) name. When the visual label and accessible (programmatic) name for interactive components are synchronized, users using speech input can engage with those components successfully.

What this Accessibility Rule Checks

For any user interface element with a visible text label, the accessible name must match (or include) the label’s visible text.

Learn more:

Related Accessibility Rules