aria-describedby & aria-details Validator

Paste HTML and verify that all aria-describedby references resolve to real IDs

Ad placeholder (leaderboard)

ARIA attributes like aria-describedby and aria-labelledby wire an element to other elements by ID. If the target ID does not exist, the reference fails silently: there is no console error, no visual change, just a missing description that a screen reader user never hears. This validator scans your markup and reports every broken reference so you can catch them before they ship.

How it works

The tool parses your pasted HTML with the browser’s own parser, then walks every element carrying an ID-referencing ARIA attribute:

  • aria-describedby — additional description announced after the name
  • aria-labelledby — the accessible name itself
  • aria-details — a reference to richer, structured details
  • aria-controls, aria-owns, aria-flowto, aria-activedescendant, aria-errormessage — other IDREF/IDREF-list attributes that fail the same way

Each attribute value is split on whitespace into individual IDs (these attributes take a space-separated IDREF list). For every ID the tool checks whether an element with that exact id exists in the parsed document. A reference is resolved if every ID it lists is found, and broken if any ID is missing. The validator also collects all id values and flags duplicates, because a reference that resolves to the wrong duplicate is just as buggy as one that resolves to nothing.

Example

Given:

<input aria-describedby="hint err" id="email" />
<span id="hint">We never share your email.</span>

The reference lists two IDs, hint and err. hint resolves, but there is no element with id="err", so the validator reports a broken reference on the input pointing at the missing err. A screen reader would announce only the hint, silently dropping the intended error description.

Tips and notes

  • A broken reference produces no runtime error, so it survives manual testing easily — automated checks like this one are the reliable way to catch it.
  • Keep error-message elements in the DOM (visually hidden if needed) so that aria-describedby and aria-errormessage always resolve, rather than adding and removing them.
  • Avoid duplicate IDs entirely; they break ARIA references and violate WCAG 4.1.1.
  • All processing is local to your browser; nothing you paste leaves the page.
Ad placeholder (rectangle)