Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

aria-hidden — exclude redundant accessible content

`aria-hidden` can remove redundant contents from the accessibility tree without hiding them on screen.

Version: WAI-ARIA 1.2

Syntax

<span aria-hidden="true">★</span>

The string true excludes an element and its subtree from assistive-technology presentation. A descendant’s false cannot undo an ancestor’s hidden state. This does not replace CSS or protect confidential data.

Do not apply it to focusable elements or their ancestors. Keep equivalent meaning and functionality available to screen-reader users. Content already hidden by HTML or CSS usually needs no extra declaration.

The example excludes a decorative star and its child from the Save button’s name. The decoration remains visible; even the child’s explicit override does not restore it to the tree. The test checks screen dimensions and the button name, without removing contents from the DOM.

Examples

<!doctype html><meta charset="utf-8">
<button id="save"><span id="star" aria-hidden="true">★<span aria-hidden="false">!</span></span> Save</button>
<output id="result"></output>
<script>
document.querySelector('#result').textContent = 'decorativeVisible=' + (document.querySelector('#star').getBoundingClientRect().width > 0);
</script>

Result

decorativeVisible=true

Verified a visible decoration alongside the absence of its characters from the exposed button name.

Sources