Element.ariaLabel is an instance property that reflects the aria-label attribute. Learn how it supplies an accessible name as a string (or null), when to use it for icon-only controls, and how to get or set it from JavaScript—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String or null
03
Purpose
Accessible name
04
Reflects
aria-label
05
Status
Baseline widely
06
Best for
Icon-only controls
Fundamentals
Introduction
Every interactive control needs an accessible name. A button that only shows X may be clear visually, but a screen reader needs a spoken name like “Close” or “Close dialog”.
aria-label provides that name as a string. ariaLabel is the JavaScript reflection of that attribute.
Prefer visible text or a <label> when you can. Use aria-label when the visible content is not a good name (icons, symbols, empty regions). Keep the string short and accurate.
Concept
Understanding the Property
MDN: the ariaLabel property of the Element interface reflects the value of the aria-label attribute, which defines a string value that labels the current element.
Reflected attribute — mirrors aria-label.
Get / set — readable and writable string (or null).
Accessible name — helps AT announce what the control is.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaLabel
Value
A string or null.
Situation
Typical result
aria-label="Close"
"Close"
Attribute omitted
null in many browsers
Assign a new string
Updates the reflected attribute
⚠️
Naming tip
If a control already has clear visible text, duplicating it with aria-label is usually unnecessary. For icon-only UI, a concise label is essential.
Pattern
📋 MDN Example Shape
MDN starts with aria-label="Close" on an icon-style button, then updates it to "Close dialog":
Element.ariaLabel 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.ariaLabel
String or null — reflects aria-label for an element's accessible name.
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 ariaLabel IDL — use setAttribute
No
ariaLabelBaseline
Bottom line: Use ariaLabel to give controls a clear accessible name when visible text is missing or unclear. Keep strings short and accurate. Prefer visible labels when you can.
Wrap Up
Conclusion
ariaLabel reflects aria-label so you can set a string accessible name from JavaScript. It shines on icon-only controls; when clear visible text exists, prefer that instead and keep names accurate.
Reflected aria-label string for an element's accessible name.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
string | null
accessible name
Type
🔍03
Icon-only UI
common use case
When
✅04
Baseline
widely available
Status
🎯05
Prefer visible
when text exists
Rule
❓ Frequently Asked Questions
It reflects the aria-label attribute as a string (or null), which defines a string value that labels the current element for assistive technologies.
No. MDN marks Element.ariaLabel as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
A string or null. When the attribute is missing, many browsers return null.
Use it when a control has no clear visible text name—for example an icon-only button like "X" for close. Prefer a visible <label> or aria-labelledby when a visible name already exists.
For many elements, aria-label becomes the accessible name and can override text content for assistive technologies. Keep the label accurate and concise.
Yes. Reading and writing ariaLabel updates the reflected aria-label attribute.
Did you know?
aria-label and aria-labelledby both contribute to accessible names, but they work differently: one embeds the name string on the element, the other points to visible text elsewhere in the page. Prefer aria-labelledby when the name already exists on screen.