References

Beginner-friendly references for web development, with live, editable examples.

The HTML aria-describedby attribute

ARIA Accessibility All modern browsers Updated
Quick answer

The aria-describedby attribute adds an accessible description (extra, supporting information) to an element by referencing the id of one or more other elements. Value: a space-separated list of element ids.

Overview

The aria-describedby attribute provides an accessible description by referencing the id of one or more elements.

It is one of ARIA's naming and description properties, which give an element an accessible name or description for assistive technology. Whenever you can, associate visible text — a <label>, or aria-labelledby pointing at on-screen text — so sighted and screen-reader users get the same information, rather than hiding it in an invisible string.

Like all ARIA, aria-describedby changes only the accessibility tree — what assistive technology perceives — never the element's behavior or appearance. The first rule of ARIA applies: if a native HTML element or attribute conveys this, use that instead, and only reach for ARIA when nothing native fits.

Syntax

<input aria-describedby="pw-hint">
<p id="pw-hint">At least 12 characters.</p>

Values

Value
A space-separated list of element id values.

Example

Live example
<label for="pw">Password</label>
<input id="pw" type="password" aria-describedby="pw-hint">
<p id="pw-hint">Use at least 12 characters.</p>

Best practices

  • Follow the first rule of ARIA — use a native HTML element or attribute that conveys this where one exists, rather than adding ARIA.
  • Prefer referencing visible text (a <label> or aria-labelledby) over an invisible string where possible.
  • Use aria-label only when there is no suitable on-screen text to reference.
  • Keep the name concise and meaningful — it is exactly what a screen reader announces.

Frequently asked questions

What does aria-describedby do?
Provides an accessible description by referencing the id of one or more elements.
What is the difference between aria-label and aria-labelledby?
aria-label takes a string you write; aria-labelledby references the id of visible text on the page, which is usually preferable.
Does this attribute change what is displayed?
No. Naming and description properties affect only what assistive technology announces, not the visible page.
Do I need aria-describedby if native HTML already conveys it?
Usually not. ARIA is for what native HTML cannot express; redundant or incorrect ARIA can make accessibility worse. Reach for it only when no native element fits.