JavaScript Element ariaFlowToElements Property

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

What You’ll Learn

Element.ariaFlowToElements is an instance property that holds an array of elements for an alternate reading order. Learn how it relates to aria-flowto, when one vs many targets matter, 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-flowto

05

Status

Baseline 2025

06

Use for

Alternate reading paths

Introduction

Documents usually flow in DOM order: section 1, then 2, then 3. Sometimes authors want to offer an alternate path—for example jump from section 1 to section 3—that assistive technologies can present as a choice.

aria-flowto advertises that alternate order. ariaFlowToElements is the modern element-reference form: you work with real DOM nodes instead of only managing id strings.

JavaScript
const next = section1.ariaFlowToElements;
next.forEach((el) => console.log(el.id));
💡
Beginner tip

One target means “next in the alternate path.” Multiple targets mean several possible paths that AT may offer for selection (MDN). This does not rewrite how a typical sighted browser scrolls the page by itself.

Understanding the Property

MDN: the ariaFlowToElements property of the Element interface is an array containing the element (or elements) that provide an alternate reading order of content, overriding the general default reading order at the user’s discretion.

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

📝 Syntax

JavaScript
ariaFlowToElements

Value

An array of subclasses of HTMLElement.

  • One element — the next element in the alternate reading order.
  • Multiple elements — each represents a possible path to offer.
  • 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-flowto Attribute

AttributeProperty
APIaria-flowto="section3"el.ariaFlowToElements
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)

📋 Alternate Section Flow (MDN Shape)

MDN’s example has three sections in normal order, plus an alternate path that jumps from section 1 to section 3 (and back) via aria-flowto:

JavaScript
<div id="section1" class="section" aria-flowto="section3">
  <h2>Section 1</h2>
  <p>First section in normal flow. Section 3 is alternate flow.</p>
  <a href="#section2">Jump to Section 2 (normal flow)</a>
</div>

<div id="section2" class="section">
  <h2>Section 2</h2>
  <p>Second section in normal flow.</p>
  <a href="#section3">Jump to Section 3 (normal flow)</a>
</div>

<div id="section3" class="section" aria-flowto="section1">
  <h2>Section 3</h2>
  <p>Third section in normal flow (end of flow). Section 1 is alternate flow.</p>
</div>

MDN notes the example is illustrative unless accessibility tools are running—browsers do not automatically follow the alternate path for everyone.

⚡ Quick Reference

GoalCode / note
Feature-detect"ariaFlowToElements" in Element.prototype
Readel.ariaFlowToElements
Writeel.ariaFlowToElements = [section3]
Attribute formaria-flowto="section3"
MDN statusBaseline Newly available (Apr 2025)

🔍 At a Glance

Four facts about Element.ariaFlowToElements.

Kind
get / set

Instance

Type
HTMLElement[]

Static copy

ARIA
aria-flowto

Reflected

Baseline
2025

Newly available

Examples Gallery

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

📚 Getting Started

Detect support and read MDN’s section flow example.

Example 1 — Feature-Detect

Check whether the reflected property exists.

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

How It Works

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

Example 2 — Get Flow-To Elements (MDN)

Log each section’s attribute and resolved flow-to element ids.

JavaScript
if ("ariaFlowToElements" in Element.prototype) {
  const sections = document.querySelectorAll(".section");
  sections.forEach((sectionDivElement) => {
    console.log(sectionDivElement.id);
    console.log(" aria-flowto:", sectionDivElement.getAttribute("aria-flowto"));
    console.log(" ariaFlowToElements:");
    sectionDivElement.ariaFlowToElements?.forEach((elem) => {
      console.log("  id:", elem.id);
    });
  });
} else {
  console.log("ariaFlowToElements not supported by browser");
}
Try It Yourself

How It Works

The property resolves valid in-scope id references from aria-flowto into real element objects.

📈 Set Array, Attribute Sync & Snapshot

Assign flow targets without ids and verify reflection rules.

Example 3 — Set Flow-To Array

Assign a next section that has no id; the attribute is cleared after set.

JavaScript
const a = document.createElement("div");
const b = document.createElement("div");
a.textContent = "Start";
b.textContent = "Alternate next";
document.body.append(a, b);

if ("ariaFlowToElements" in Element.prototype) {
  a.ariaFlowToElements = [b];
  console.log({
    count: a.ariaFlowToElements.length,
    attrAfterSet: a.getAttribute("aria-flowto"),
    nextText: a.ariaFlowToElements.map((e) => e.textContent).join(" ")
  });
} else {
  console.log("ariaFlowToElements not supported by browser");
}
Try It Yourself

How It Works

MDN: setting the property clears the corresponding attribute. Flow targets 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 section1 = document.getElementById("section1");

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

How It Works

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

Example 5 — Support Snapshot

Feature-detect and review static-array rules.

JavaScript
console.log({
  supported: "ariaFlowToElements" in Element.prototype,
  tip: "Returned array is static/read-only; assigned arrays are copied",
  meaning: "Alternate reading paths for AT — not automatic page scroll",
  status: "Baseline Newly available (MDN, Apr 2025)"
});
Try It Yourself

How It Works

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

🚀 Common Use Cases

  • Offering an alternate reading path through long multi-section content.
  • Complex layouts where DOM order is not the preferred AT path.
  • Dynamic UIs that attach flow targets without assigning ids.
  • Keeping script and markup aligned without manual setAttribute.
  • Custom elements via ElementInternals.ariaFlowToElements.

🔧 How It Works

1

You declare an alternate next element

Via aria-flowto ids or an element array.

Wire
2

Browser resolves element references

Valid in-scope ids become HTMLElement objects.

Resolve
3

AT may offer the alternate path

Users can choose the flow-to destination when supported.

Choice
4

Default order still exists

Normal DOM order remains available alongside the alternate.

📝 Notes

Browser Support

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

Baseline 2025

Element.ariaFlowToElements

HTMLElement[] — reflected aria-flowto alternate reading paths.

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-flowto attribute
No
ariaFlowToElements Baseline

Bottom line: Detect "ariaFlowToElements" in Element.prototype. Prefer element arrays for dynamic flow targets. Fall back to aria-flowto id strings when the property is missing. Re-assign arrays when paths change.

Conclusion

ariaFlowToElements lets you declare alternate reading-order targets with real Element references. Feature-detect on older browsers, remember that AT may offer the path rather than auto-jumping for everyone, and re-assign the array when targets change.

Continue with ariaHasPopup, ariaExpanded, EventTarget, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Feature-detect before using the property
  • Keep a sensible default DOM reading order
  • Use one target for a single next path
  • Assign a fresh array when flow targets change
  • Keep id-based aria-flowto as a fallback

❌ Don’t

  • Mutate a previously assigned array and expect updates
  • Assume every older browser exposes the IDL property
  • Expect normal browsers to auto-scroll alternate paths
  • Point to empty or unrelated elements
  • Confuse this with ariaControlsElements

Key Takeaways

Knowledge Unlocked

Five things to remember about ariaFlowToElements

Reflected aria-flowto as an array of alternate reading-order elements.

5
Core concepts
📝 02

Element array

HTMLElement[]

Type
🔍 03

No id needed

when property-set

Rule
04

Baseline

newly available

Status
🎯 05

AT choice

not auto-scroll

Tip

❓ Frequently Asked Questions

An array of HTMLElement subclasses that provide an alternate reading order, overriding the default order at the user's discretion. One element means the next path; multiple elements mean possible paths to offer.
No. MDN marks Element.ariaFlowToElements 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.
No. aria-flowto / ariaFlowToElements advertise alternate paths that accessibility tools may offer. Sighted users following normal document order are unchanged unless you also provide visible navigation.
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.ariaFlowToElements for the same relationship from inside a component.
Did you know?

MDN’s section demo still includes ordinary links for normal flow (Jump to Section 2). Alternate aria-flowto paths complement visible navigation—they do not replace a clear document structure.

Next: Element ariaHasPopup

Learn the reflected aria-haspopup property for popup type availability.

ariaHasPopup →

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