Element.ariaHidden is an instance property that reflects the aria-hidden attribute. Learn the true, false, and undefined tokens, how they control exposure to accessibility APIs, and how to get or set the property from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String
03
Values
true · false · undefined
04
Reflects
aria-hidden
05
Status
Baseline widely
06
Affects
Accessibility API
Fundamentals
Introduction
Sighted users and assistive technology users do not always need the same content. Decorative icons, duplicated text, or off-screen panels can clutter the accessibility tree if they stay exposed.
aria-hidden tells the accessibility API whether an element should be exposed. ariaHidden is the JavaScript reflection of that attribute.
JavaScript
const el = document.getElementById("hidden");
console.log(el.ariaHidden); // "true"
el.ariaHidden = "false";
💡
Beginner tip
aria-hidden="true" hides content from assistive technologies—not necessarily from the screen. Do not put focusable controls (links, buttons, inputs) inside a subtree marked aria-hidden="true". Prefer removing content, using the HTML hidden attribute, or inert when you need both visual and interaction hiding.
Concept
Understanding the Property
MDN: the ariaHidden property of the Element interface reflects the value of the aria-hidden attribute, which indicates whether the element is exposed to an accessibility API.
Reflected attribute — mirrors aria-hidden.
Get / set — readable and writable string.
Three tokens — true, false, undefined.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaHidden
Value
A string with one of the following values:
Value
Meaning (MDN)
"true"
The element is hidden from the accessibility API.
"false"
The element is exposed to the accessibility API as if it were rendered.
"undefined"
The element’s hidden state is determined by the user agent based on whether it is rendered.
⚠️
Focus trap warning
If keyboard focus can land on something inside aria-hidden="true", users may hear nothing useful while still being able to interact. Hide or disable focusable descendants when you hide a region from AT.
Pattern
📋 MDN Example Shape
MDN starts with aria-hidden="true" on a div, then updates it to "false" with the property:
JavaScript
<div id="hidden" aria-hidden="true">Some things are better left unsaid.</div>
JavaScript
let el = document.getElementById("hidden");
console.log(el.ariaHidden); // true
el.ariaHidden = "false";
console.log(el.ariaHidden); // false
Cheat Sheet
⚡ Quick Reference
Goal
Code / note
Read
el.ariaHidden
Hide from AT
el.ariaHidden = "true"
Expose to AT
el.ariaHidden = "false"
UA decides
el.ariaHidden = "undefined"
Not CSS hide
Use CSS / hidden / inert for visual/interaction
MDN status
Baseline Widely available
Snapshot
🔍 At a Glance
Four facts about Element.ariaHidden.
Kind
get / set
Instance
Type
string
true / false / undefined
Reflects
aria-hidden
Attribute
Baseline
widely
Oct 2023+
Hands-On
Examples Gallery
Examples follow MDN Element: ariaHidden. Labs use a simple element so you can safely read and write the property.
📚 Getting Started
Read the reflected value and follow MDN’s update.
Example 1 — Read ariaHidden
Log whether an element is currently marked hidden from AT.
JavaScript
const el = document.getElementById("hidden");
console.log(el.ariaHidden);
// HTML includes: aria-hidden="true"
Decorative icons and duplicate text are common places for aria-hidden="true". Keep a meaningful accessible name on the real control (for example via visible text or aria-label).
Example 4 — Property vs getAttribute
Confirm the attribute stays in sync after a write.
JavaScript
const el = document.createElement("div");
el.setAttribute("aria-hidden", "true");
el.textContent = "Some things are better left unsaid.";
document.body.appendChild(el);
el.ariaHidden = "false";
console.log({
fromProperty: el.ariaHidden,
fromAttribute: el.getAttribute("aria-hidden"),
same: el.ariaHidden === el.getAttribute("aria-hidden")
});
Use ariaHidden only when you intentionally want AT to skip content that may still be visible. For fully unused UI, prefer removing it or using inert / hidden.
Applications
🚀 Common Use Cases
Hiding decorative icons that duplicate adjacent text.
Exposing previously off-screen or modal backdrop content again.
Keeping visual-only flourishes out of the accessibility tree.
Toggling AT exposure when a panel becomes relevant.
Keeping script and markup aligned without manual setAttribute.
Under the Hood
🔧 How It Works
1
Element may clutter the accessibility tree
Decorative or duplicate content does not need AT exposure.
Content
2
Set ariaHidden to true, false, or undefined
The property reflects aria-hidden for get and set.
Declare
3
Ensure no focusable traps remain
Hide or disable interactive descendants when AT-hiding a region.
Safety
4
✓
Assistive tech skips or includes the element
Users hear meaningful content without decorative noise.
Important
📝 Notes
Not Deprecated, Experimental, or Non-standard on MDN (Baseline Widely available).
aria-hidden is not a substitute for CSS hide or the HTML hidden attribute.
Never leave focusable content inside aria-hidden="true".
Element.ariaHidden is Baseline Widely available (MDN: across browsers since October 2023). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline Widely available
Element.ariaHidden
String true / false / undefined — reflects aria-hidden for accessibility API exposure.
BaselineWidely available
Google ChromeSupported (ARIA reflection)
Yes
Microsoft EdgeSupported (ARIA reflection)
Yes
Mozilla FirefoxSupported (ARIA reflection)
Yes
Apple SafariSupported (ARIA reflection)
Yes
OperaFollow Chromium support
Yes
Internet ExplorerNo ariaHidden IDL — use setAttribute
No
ariaHiddenBaseline
Bottom line: Use ariaHidden to control whether an element is exposed to accessibility APIs. Prefer removing or inerting unused interactive UI. Never leave focusable controls inside aria-hidden="true".
Wrap Up
Conclusion
ariaHidden reflects aria-hidden so you can hide or expose an element in the accessibility tree with a string token. Use it carefully for decorative or duplicate content, keep focusable controls out of hidden subtrees, and prefer stronger hiding tools when interaction must stop too.
Remove focus from descendants when hiding a region
Prefer inert / hidden when interaction must stop
Test with a screen reader after toggling exposure
❌ Don’t
Use aria-hidden as your only way to hide interactive UI
Leave buttons or links inside aria-hidden="true"
Hide the only copy of important information
Confuse AT hide with CSS display: none
Forget to restore "false" when content becomes relevant
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ariaHidden
Reflected aria-hidden string for accessibility API exposure.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
Three tokens
true false undefined
Values
🔍03
AT exposure
not CSS visibility
Rule
✅04
Baseline
widely available
Status
🎯05
No focus traps
inside hidden subtrees
Safety
❓ Frequently Asked Questions
It reflects the aria-hidden attribute as a string, indicating whether the element is exposed to an accessibility API (hidden from AT, exposed, or left to the user agent).
No. MDN marks Element.ariaHidden as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
The strings "true", "false", or "undefined". "true" hides the element from the accessibility API; "false" exposes it; "undefined" lets the user agent decide based on whether it is rendered.
No. CSS can hide content visually. aria-hidden="true" hides content from assistive technologies even if it remains visible on screen. Prefer removing or inerting content you do not want announced, and never leave focusable controls inside aria-hidden="true".
The element's hidden state for accessibility is determined by the user agent based on whether the element is rendered (MDN).
Yes. Reading and writing ariaHidden updates the reflected aria-hidden attribute.
Did you know?
Setting aria-hidden="false" can force an element into the accessibility tree even when browsers might otherwise treat it as not rendered—use it when you need AT to hear something that CSS has visually altered, and avoid it when content should stay out of both sight and AT.