JavaScript Element ariaDescribedByElements Property

Beginner
⏱️ 12 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Baseline 2025
Instance property

What You’ll Learn

Element.ariaDescribedByElements is an instance property that holds an array of elements providing an accessible description. Learn how it relates to aria-describedby, why description targets do not need an id when you set the property, and how to get or set the relationship from JavaScript—with five examples and try-it labs.

01

Kind

Instance property

02

Returns

HTMLElement[]

03

Writable

Yes (get / set)

04

Reflects

aria-describedby

05

Status

Baseline 2025

06

Use for

Accessible descriptions

Introduction

Controls often need extra help text: a warning under a destructive button, a hint next to a field, or longer context that is not part of the short accessible name. ARIA exposes that with aria-describedby.

ariaDescribedByElements is the modern element-reference form: you work with real DOM nodes instead of only managing id strings. The accessible description is similar to a label, but usually more verbose.

JavaScript
const describedBy = button.ariaDescribedByElements;
const text = describedBy.map((e) => e.textContent.trim()).join(" ");
console.log(text);
💡
Beginner tip

Think: label names the control; description adds longer help. Prefer ariaDescribedByElements (or aria-describedby) for that help text—not for the short name.

Understanding the Property

MDN: the ariaDescribedByElements property of the Element interface is an array containing the element (or elements) that provide an accessible description for the element it is applied to. The accessible description is similar to the accessible label (see ariaLabelledByElements), but provides more verbose information.

  • Get / set — read or assign an array of elements.
  • Flexible alternative to the aria-describedby attribute.
  • No id required on description nodes when you set the property (MDN).
  • Reflection — reads valid in-scope id refs from the attribute; setting the property clears the attribute.

📝 Syntax

JavaScript
ariaDescribedByElements

Value

An array of subclasses of HTMLElement. The inner text of these elements can be joined with spaces to get the accessible description.

  • When read, the returned array is static and read-only.
  • When written, the assigned array is copied—later edits to that array do not change the property.

⚖️ Property vs aria-describedby Attribute

AttributeProperty
APIaria-describedby="id1 id2"el.ariaDescribedByElements
Points toSpace-separated id stringsArray of Element objects
Targets need id?YesNo (when set via property)
After you set the propertyCorresponding attribute is cleared (MDN)

📋 Button With Descriptions (MDN Shape)

MDN’s example links a button to two description spans via aria-describedby. Those spans can be visually hidden while still providing the accessible description:

JavaScript
<button aria-describedby="trash-desc1 trash-desc2">Move to trash</button>

<span id="trash-desc1">Trash will be permanently removed after 30 days.</span>
<span id="trash-desc2">Or Else!</span>

Related element-reference property: ariaControlsElements (controlled regions, not description text).

⚡ Quick Reference

GoalCode / note
Feature-detect"ariaDescribedByElements" in Element.prototype
Readel.ariaDescribedByElements
Writeel.ariaDescribedByElements = [d1, d2]
Build description stringarr.map((e) => e.textContent.trim()).join(" ")
Attribute formaria-describedby="id1 id2"
MDN statusBaseline Newly available (Apr 2025)

🔍 At a Glance

Four facts about Element.ariaDescribedByElements.

Kind
get / set

Instance

Type
HTMLElement[]

Static copy

ARIA
aria-describedby

Reflected

Baseline
2025

Newly available

Examples Gallery

Examples follow MDN Element: ariaDescribedByElements. Labs feature-detect first so older browsers still show a clear message.

📚 Getting Started

Detect support and read MDN’s button / description example.

Example 1 — Feature-Detect

Check whether the reflected property exists.

JavaScript
if ("ariaDescribedByElements" in Element.prototype) {
  console.log("ariaDescribedByElements is supported");
} else {
  console.log("ariaDescribedByElements not supported by browser");
}
Try It Yourself

How It Works

Matches MDN’s feature test before reading or writing the property.

Example 2 — Get Description Elements (MDN)

Read the attribute ids, then the element array and the joined accessible description.

JavaScript
const buttonElement = document.querySelector("button");

console.log("aria-describedby:", buttonElement.getAttribute("aria-describedby"));

if ("ariaDescribedByElements" in Element.prototype) {
  const buttonElements = buttonElement.ariaDescribedByElements;
  console.log("count:", buttonElements.length);
  const text = buttonElements.map((e) => e.textContent.trim()).join(" ");
  console.log("Accessible description:", text.trim());
} else {
  console.log("ariaDescribedByElements not supported by browser");
}
Try It Yourself

How It Works

The property resolves valid in-scope id references from aria-describedby into real element objects. Joining textContent rebuilds the description AT announces.

📈 Set Array, Attribute Sync & Snapshot

Assign description nodes without ids and verify reflection rules.

Example 3 — Set Description Array

Assign elements that have no id; the attribute is cleared after set.

JavaScript
const btn = document.createElement("button");
const d1 = document.createElement("span");
const d2 = document.createElement("span");
d1.textContent = "Files stay in trash for 30 days.";
d2.textContent = "This cannot be undone.";
document.body.append(btn, d1, d2);

if ("ariaDescribedByElements" in Element.prototype) {
  btn.ariaDescribedByElements = [d1, d2];
  console.log({
    count: btn.ariaDescribedByElements.length,
    attrAfterSet: btn.getAttribute("aria-describedby"),
    text: btn.ariaDescribedByElements.map((e) => e.textContent).join(" ")
  });
} else {
  console.log("ariaDescribedByElements not supported by browser");
}
Try It Yourself

How It Works

MDN: setting the property clears the corresponding attribute. Description nodes do not need ids when linked this way.

Example 4 — Attribute Ids vs Resolved Elements

Compare the id string with the resolved element ids from the property.

JavaScript
const btn = document.querySelector("button");

console.log({
  fromAttribute: btn.getAttribute("aria-describedby"),
  supported: "ariaDescribedByElements" in Element.prototype,
  fromProperty: "ariaDescribedByElements" in Element.prototype
    ? btn.ariaDescribedByElements.map((el) => el.id)
    : null
});
Try It Yourself

How It Works

Prefer the property in script when supported; keep id-based aria-describedby as a markup fallback for older browsers.

Example 5 — Support Snapshot

Feature-detect and review static-array rules.

JavaScript
console.log({
  supported: "ariaDescribedByElements" in Element.prototype,
  tip: "Returned array is static/read-only; assigned arrays are copied",
  pairsWith: "ariaLabelledByElements for the accessible name",
  status: "Baseline Newly available (MDN, Apr 2025)"
});
Try It Yourself

How It Works

Re-assign a fresh array when description nodes change. Do not mutate an old array and expect the relationship to update.

🚀 Common Use Cases

  • Destructive actions with warning text (trash, delete, reset).
  • Form fields linked to hint or error message elements.
  • Icon-only buttons that need longer spoken help beyond a short name.
  • Dynamic UIs that attach description nodes without assigning ids.
  • Custom elements via ElementInternals.ariaDescribedByElements.

🔧 How It Works

1

You point to description nodes

Via aria-describedby ids or an element array.

Wire
2

Browser resolves element references

Valid in-scope ids become HTMLElement objects.

Resolve
3

Text is joined into a description

Inner text of the referenced elements forms the string.

Text
4

Assistive tech speaks the help text

Often after the accessible name when the control is focused.

📝 Notes

Browser Support

Element.ariaDescribedByElements is Baseline Newly available (MDN: across latest browsers since April 2025). Feature-detect on older engines and keep an aria-describedby id fallback if needed. Logos use the shared browser-image-sprite.png sprite from this project.

Baseline 2025

Element.ariaDescribedByElements

HTMLElement[] — reflected aria-describedby element references.

Baseline Newly available 2025
Google Chrome Supported in current releases — feature-detect older
Yes
Microsoft Edge Supported in current releases — feature-detect older
Yes
Mozilla Firefox Supported in current releases — feature-detect older
Yes
Apple Safari Supported in current releases — feature-detect older
Yes
Opera Follow Chromium support
Yes
Internet Explorer Not supported — use aria-describedby attribute
No
ariaDescribedByElements Baseline

Bottom line: Detect "ariaDescribedByElements" in Element.prototype. Prefer element arrays for dynamic description text. Fall back to aria-describedby id strings when the property is missing. Re-assign arrays when description nodes change.

Conclusion

ariaDescribedByElements lets you manage accessible descriptions with real Element references instead of only id strings. Feature-detect on older browsers, keep description text clear and up to date, and re-assign the array when the help nodes change.

Continue with ariaDescription, ariaCurrent, EventTarget, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect before using the property
  • Use descriptions for longer help, not the short name
  • Assign a fresh array when description nodes change
  • Keep id-based aria-describedby as a fallback
  • Keep description text accurate and concise enough to announce

❌ Don’t

  • Mutate a previously assigned array and expect updates
  • Assume every older browser exposes the IDL property
  • Duplicate the accessible name inside the description
  • Point to empty or unrelated elements
  • Confuse this with ariaControlsElements

Key Takeaways

Knowledge Unlocked

Five things to remember about ariaDescribedByElements

Reflected aria-describedby as an array of element references.

5
Core concepts
📝 02

Element array

HTMLElement[]

Type
🔍 03

No id needed

when property-set

Rule
04

Baseline

newly available

Status
🎯 05

Detect

older browsers

Tip

❓ Frequently Asked Questions

An array of HTMLElement subclasses that provide an accessible description for the element. Join their inner text with spaces to form the description string.
No. MDN marks Element.ariaDescribedByElements as Baseline 2025 (newly available since April 2025). It is not Deprecated, Experimental, or Non-standard. Feature-detect on older browsers.
The attribute uses space-separated id strings. The property uses Element references. Assigned elements do not need an id. Setting the property clears the corresponding attribute.
An accessible label names the control (see ariaLabelledByElements). An accessible description adds longer help text—warnings, hints, or extra context.
No. When read, the returned array is static and read-only. When written, the assigned array is copied—later changes to that array do not update the property.
Yes. Custom elements can use ElementInternals.ariaDescribedByElements for the same relationship from inside a component.
Did you know?

Description elements are often visually hidden with CSS while remaining in the accessibility tree—users who see the UI may rely on nearby visible hints, while screen reader users still hear the joined description text.

Next: Element ariaDescription

Learn the reflected aria-description string property for annotating elements.

ariaDescription →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful