JavaScript Element ariaOwnsElements Property

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

What You’ll Learn

Element.ariaOwnsElements is an instance property that holds an array of elements owned by the current element when the DOM tree cannot express that relationship. Learn how it relates to aria-owns, why owned nodes 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

Element array

03

Writable

Yes (get / set)

04

Reflects

aria-owns

05

Status

Limited availability

06

Use for

Ownership links

Introduction

Assistive technologies usually learn “what belongs to what” from the DOM: a submenu nested inside a menu, a panel inside a dialog. Sometimes layout or framework constraints force related nodes to sit as siblings (or farther apart). Then the tree no longer tells the ownership story.

aria-owns fills that gap. ariaOwnsElements is the modern element-reference form: you work with real DOM nodes instead of only managing id strings.

JavaScript
if ("ariaOwnsElements" in Element.prototype) {
  const owned = parentMenu.ariaOwnsElements;
  owned.forEach((elem) => console.log(elem.id));
}
💡
Beginner tip (MDN)

Prefer real DOM nesting when you can. Use aria-owns / ariaOwnsElements only when the ownership relationship cannot be represented in the hierarchy. Feature-detect—support is limited and not Baseline yet.

Understanding the Property

MDN: the ariaOwnsElements property of the Element interface is an array containing the element (or elements) that define a visual, functional, or contextual relationship between a parent element that it is applied to, and its child elements. This is used when the DOM hierarchy cannot be used to represent the relationship, and it would not otherwise be available to assistive technology.

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

📝 Syntax

JavaScript
ariaOwnsElements

Value

An array of subclasses of HTMLElement—the owned element(s).

  • 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-owns Attribute

AttributeProperty
APIaria-owns="id1 id2"el.ariaOwnsElements
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)

⚡ Quick Reference

GoalCode / note
Feature-detect"ariaOwnsElements" in Element.prototype
Readel.ariaOwnsElements
Writeel.ariaOwnsElements = [owned]
List owned idsarr.forEach((e) => console.log(e.id))
Attribute formaria-owns="subMenu1"
MDN statusLimited availability (not Baseline)

🔍 At a Glance

Four facts about Element.ariaOwnsElements.

Kind
get / set

Instance

Type
Element[]

Static copy

ARIA
aria-owns

Reflected

Support
limited

Feature-detect

Examples Gallery

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

📚 Getting Started

Detect support and read MDN’s menu ownership example.

Example 1 — Feature-Detect

Check whether the reflected property exists.

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

How It Works

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

Example 2 — Get Owned Elements (MDN)

Read the aria-owns attribute, then the element array and each owned id.

JavaScript
const parentMenu = document.querySelector("#parentMenu");

console.log("aria-owns:", parentMenu.getAttribute("aria-owns"));

if ("ariaOwnsElements" in Element.prototype) {
  console.log("ariaOwnsElements:", parentMenu.ariaOwnsElements);
  parentMenu.ariaOwnsElements?.forEach((elem) => {
    console.log("  id:", elem.id);
  });
} else {
  console.log("ariaOwnsElements not supported by browser");
}
Try It Yourself

How It Works

The property resolves valid in-scope id references from aria-owns into real element objects so you can inspect ownership without parsing id strings by hand.

📈 Set Array, Attribute Sync & Snapshot

Assign owned nodes without ids and verify reflection rules.

Example 3 — Set Owned Array

Assign an owned element that has no id; the attribute is cleared after set.

JavaScript
const parent = document.createElement("div");
const owned = document.createElement("div");
parent.setAttribute("role", "menubar");
owned.setAttribute("role", "menu");
owned.textContent = "Submenu panel";
document.body.append(parent, owned);

if ("ariaOwnsElements" in Element.prototype) {
  parent.ariaOwnsElements = [owned];
  console.log({
    count: parent.ariaOwnsElements.length,
    attrAfterSet: parent.getAttribute("aria-owns"),
    ownedRole: parent.ariaOwnsElements[0].getAttribute("role")
  });
} else {
  console.log("ariaOwnsElements not supported by browser");
}
Try It Yourself

How It Works

MDN: setting the property clears the corresponding attribute. Owned 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 parentMenu = document.querySelector("#parentMenu");

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

How It Works

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

Example 5 — Support Snapshot

Feature-detect and review static-array rules.

JavaScript
console.log({
  supported: "ariaOwnsElements" in Element.prototype,
  tip: "Returned array is static/read-only; assigned arrays are copied",
  prefer: "Real DOM nesting when possible; aria-owns only when needed",
  status: "Limited availability (MDN, not Baseline)"
});
Try It Yourself

How It Works

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

🚀 Common Use Cases

  • Menus whose submenus live outside the parent node for layout reasons.
  • Composite widgets where owned panels are portals or siblings in the DOM.
  • Dynamic UIs that attach owned nodes without assigning ids.
  • Teaching how AT discovers ownership when the tree alone is incomplete.
  • Custom elements via ElementInternals.ariaOwnsElements.

🔧 How It Works

1

Related nodes are not nested

DOM alone cannot express the ownership relationship.

Gap
2

You declare ownership

Via aria-owns ids or an element array.

Wire
3

Browser resolves element references

Valid in-scope refs become the property array.

Resolve
4

Assistive tech sees the owned children

Ownership is available even without DOM nesting.

📝 Notes

  • Not Deprecated, Experimental, or Non-standard on MDN—but limited availability (feature-detect).
  • Prefer real DOM nesting; use ownership only when the tree cannot represent the relationship.
  • Returned arrays are static/read-only; assigned arrays are copied.
  • Related: ariaPlaceholder, ariaLabelledByElements, EventTarget, JavaScript hub.

Browser Support

Element.ariaOwnsElements has limited availability on MDN (not Baseline yet—does not work in some widely used browsers). Logos use the shared browser-image-sprite.png sprite from this project. Always feature-detect.

Limited availability

Element.ariaOwnsElements

Element[] — reflects aria-owns for ownership element references.

Limited Not Baseline yet
Google Chrome Check current support (reflected element refs)
Partial
Microsoft Edge Check current support (reflected element refs)
Partial
Mozilla Firefox Check current support (reflected element refs)
Partial
Apple Safari Check current support (reflected element refs)
Partial
Opera Follow Chromium support
Partial
Internet Explorer No — use aria-owns + getElementById
No
ariaOwnsElements Limited

Bottom line: Use ariaOwnsElements to point at owned elements when DOM nesting cannot express ownership. Prefer real nesting when possible. Feature-detect, and keep aria-owns ids as a markup fallback when needed.

Conclusion

ariaOwnsElements reflects aria-owns as an array of elements so you can declare ownership from real DOM nodes—even without ids when you set the property. Prefer nesting when possible, feature-detect on browsers with limited support, and keep id-based markup as a fallback.

Continue with ariaPlaceholder, ariaLabelledByElements, EventTarget, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Nest related widgets in the DOM when you can
  • Feature-detect before reading or writing
  • Use ownership only when hierarchy cannot express it
  • Re-assign a new array when owned nodes change
  • Keep aria-owns ids as a markup fallback

❌ Don’t

  • Mutate a returned array and expect updates
  • Use aria-owns as a substitute for good structure
  • Point to unrelated or discarded nodes
  • Skip feature detection on older or incomplete browsers
  • Forget that setting the property clears the attribute

Key Takeaways

Knowledge Unlocked

Five things to remember about ariaOwnsElements

Reflected element array for aria-owns ownership links.

5
Core concepts
📝 02

No id needed

when setting property

Flex
🔍 03

Static copy

not a live array

Rule
04

Limited support

feature-detect

Status
🎯 05

Prefer nesting

owns is a fallback

MDN

❓ Frequently Asked Questions

An array of elements that define a visual, functional, or contextual ownership relationship with the parent element. Use it when the DOM hierarchy cannot represent that relationship for assistive technology.
No. MDN does not mark Element.ariaOwnsElements as Deprecated, Experimental, or Non-standard. It has limited availability (not Baseline yet), so feature-detect before use.
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.
Only when ownership cannot be expressed by normal DOM nesting. Prefer real parent/child structure when possible. Common teaching example: a menu and a submenu that are sibling nodes in the DOM.
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.
They need ids only when you use the aria-owns attribute. When you assign ariaOwnsElements = [elem], the elements do not require an id attribute.
Did you know?

MDN’s menu example deliberately places an unrelated sibling between the menubar and the submenu so the ownership gap is obvious. In production you would often nest the submenu—aria-owns is the escape hatch when nesting is not practical.

Next: Element ariaPlaceholder

Learn the reflected aria-placeholder property for empty-field data-entry hints.

ariaPlaceholder →

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