JavaScript Element ariaLabelledByElements Property
Beginner
5 min read
Updated: Nov 2026
3 examples
Property
Definition
In JavaScript, ariaLabelledByElements is an array of elements that provide an accessible name for the element it is applied to (MDN). It reflects aria-labelledby in some cases, but can also point to elements without an id, and takes precedence over other ARIA naming methods.
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use el.ariaLabelledByElements. Start with this line.
JavaScript
element.ariaLabelledByElements
Call
What it does
element.ariaLabelledByElements
Primary signature.
Built into the browser. Read or assign el.ariaLabelledByElements — no import required.
Library declarations
JavaScript
element.ariaLabelledByElements
Parameters
Parameter
Description
Label element(s)
Required. Provide the name text
Custom elements
Optional. ElementInternals has the same property
Return Value
Return Value
Description
*
The current value of el.ariaLabelledByElements.
JavaScript Examples
Example 1 — Read Name from aria-labelledby (MDN)
Resolve referenced elements and join their text into the accessible name.
JavaScript
const inputElement = document.querySelector("input");
if ("ariaLabelledByElements" in Element.prototype) {
const labelElements = inputElement.ariaLabelledByElements;
const text = labelElements.map((e) => e.textContent.trim()).join(" ");
console.log("Accessible name:", text.trim());
} else {
console.log("ariaLabelledByElements not supported");
}
Collect label elements. They do not need ids for the property (MDN).
Assign an array. The browser copies it into the property.
Attribute clears.aria-labelledby is removed when the property is set.
Do not mutate later. Changing the original array afterward has no effect.
Example 3 — Feature Detect
Check support before relying on reflected element references.
JavaScript
const ok = "ariaLabelledByElements" in Element.prototype;
console.log(
ok
? "ariaLabelledByElements is supported"
: "use aria-labelledby / <label> fallback"
);
ariaLabelledByElements is supported
/* or the fallback message */
How It Works
Probe the prototype. Cheap capability check.
Branch safely. Keep aria-labelledby / <label> for older engines.
Baseline 2025. Latest browsers support it; older ones may not.
Test with AT. Confirm the announced name matches your joined text.
Compatibility
Browser Support
Element.ariaLabelledByElements is marked Baseline Newly available on MDN (since April 2025). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Newly available
Element ariaLabelledByElements
Element-reference array for the accessible name — flexible alternative to aria-labelledby ids.
NewlyAvailable
Google ChromeSupported in recent versions
Supported
Mozilla FirefoxSupported in recent versions
Supported
Apple SafariSupported in recent versions
Supported
Microsoft EdgeSupported · Chromium
Supported
OperaSupported in recent versions
Supported
Internet ExplorerNot supported
Not supported
ariaLabelledByElementsBaseline 2025
Bottom line: Safe in latest browsers. Feature-detect and keep aria-labelledby / label fallbacks. See the MDN Element.ariaLabelledByElements reference.
Frequently Asked Questions
An array of elements that provide an accessible name for the element (MDN). Join their inner text with spaces to form the accessible name string.
No. MDN marks Element.ariaLabelledByElements 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 (MDN).
ariaLabel is a string name on the element itself. ariaLabelledByElements points to other elements whose text becomes the name. Prefer labelled-by when the name already exists as visible text on the page.
Yes. MDN: the property takes precedence over all other methods of setting the ARIA label, including content and associated label elements.
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 (MDN).