Skip to main content

HTML Guide

Bad value “” for attribute “aria-controls” on element “a”: An IDREFS value must contain at least one non-whitespace character.

Empty aria-controls attribute values are invalid; the attribute must reference the id of one or more elements.

The aria-controls attribute is used to indicate that the element controls the referenced element(s) by their id. According to the ARIA specification and W3C HTML standard, the attribute must contain at least one valid id value, and cannot be an empty string. Leaving aria-controls="" triggers a validation error.

Correct Usage:

  • Assign an id to the element being controlled.
  • Set the aria-controls attribute to match that id.
  • Remove aria-controls entirely if not necessary.

Incorrect Example:

<a href="#" aria-controls="">Toggle</a>

Corrected Example:

<div id="details">Some details...</div>
<a href="#" aria-controls="details">Toggle</a>

If no element is being controlled:

<a href="#">Toggle</a>

Learn more:

Related W3C validator issues