HTML: aria-hidden

The aria-hidden attribute removes an element and its descendants from the accessibility tree while leaving them visible on screen.

What you will learn

Decorative icon example

<button type="button">
  <span aria-hidden="true">★</span>
  Favorite
</button>

The visible star is decorative because the button text already says “Favorite”. The button itself remains available to assistive technology.

Values

<span aria-hidden="true">Decorative</span>
<span aria-hidden="false">Available</span>

Use the string values true and false. The attribute does not change visual display; use the hidden attribute or CSS when content should also disappear visually.

Common mistakes