aria-label

An ARIA attribute that gives an element its accessible name directly as a text string.

In more detail

It overrides the element's text content and is essential for icon-only buttons, such as aria-label="Close". It is ignored when aria-labelledby is also present, and it is not visible, so visible text is preferred when there is some.

Example

In the browser: aria-label="Main" on a nav distinguishes it from other navigation landmarks. A related attribute, aria-labelledby, points to an existing element whose text becomes the name instead.

Related terms

Taught in

References