Element.ariaKeyShortcuts is an instance property that reflects the aria-keyshortcuts attribute. Learn how to document keyboard shortcuts that activate or focus an element, how to get or set the string from JavaScript, and why you must still implement the real key handlers—with five examples and try-it labs.
01
Kind
Instance property
02
Type
String
03
Example
Alt+Shift+A
04
Reflects
aria-keyshortcuts
05
Status
Baseline widely
06
Does not
Create key handlers
Fundamentals
Introduction
Many apps offer keyboard shortcuts: skip to content, save a form, open a menu. Sighted users may see a tooltip; assistive technology users need the same information in the accessibility tree.
aria-keyshortcuts documents those shortcuts. ariaKeyShortcuts is the JavaScript reflection of that attribute.
JavaScript
const el = document.getElementById("skip-link");
console.log(el.ariaKeyShortcuts); // "Alt+Shift+A"
el.ariaKeyShortcuts = "Alt+Shift+M";
💡
Beginner tip
This property describes shortcuts you implement. It does not register keydown listeners. Always keep the string in sync with the real handler, and avoid conflicting with browser or OS shortcuts when you can.
Concept
Understanding the Property
MDN: the ariaKeyShortcuts property of the Element interface reflects the value of the aria-keyshortcuts attribute, which indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
Reflected attribute — mirrors aria-keyshortcuts.
Get / set — readable and writable string.
Author-implemented — documents shortcuts you already built.
Baseline — widely available since October 2023 (MDN).
Foundation
📝 Syntax
JavaScript
ariaKeyShortcuts
Value
A string describing the keyboard shortcut(s), for example:
Example string
Meaning
"Alt+Shift+A"
Alt, Shift, and A together
"Control+S"
Control and S (often “save”)
"Alt+Shift+A Alt+Shift+M"
Multiple shortcuts, space-separated
⚠️
Implementation warning
Setting ariaKeyShortcuts alone never activates the control. You must listen for the matching keys and call click(), move focus, or run your action yourself.
Pattern
📋 MDN Example Shape
MDN starts with aria-keyshortcuts="Alt+Shift+A" on a skip link, then updates it to "Alt+Shift+M" with the property (IDs aligned for this tutorial):
JavaScript
<a id="skip-link" href="#content" aria-keyshortcuts="Alt+Shift+A">
Skip to content
</a>
JavaScript
let el = document.getElementById("skip-link");
console.log(el.ariaKeyShortcuts); // "Alt+Shift+A"
el.ariaKeyShortcuts = "Alt+Shift+M";
console.log(el.ariaKeyShortcuts); // "Alt+Shift+M"
Cheat Sheet
⚡ Quick Reference
Goal
Code / note
Read
el.ariaKeyShortcuts
Document shortcut
el.ariaKeyShortcuts = "Alt+Shift+A"
Update string
el.ariaKeyShortcuts = "Alt+Shift+M"
Make it work
Add your own keydown handler
Multiple shortcuts
Space-separate in the string
MDN status
Baseline Widely available
Snapshot
🔍 At a Glance
Four facts about Element.ariaKeyShortcuts.
Kind
get / set
Instance
Type
string
Shortcut text
Reflects
aria-keyshortcuts
Attribute
Baseline
widely
Oct 2023+
Hands-On
Examples Gallery
Examples follow MDN Element: ariaKeyShortcuts. Labs use a skip-link style control so you can safely read and write the property.
📚 Getting Started
Read the reflected value and follow MDN’s update.
Example 1 — Read ariaKeyShortcuts
Log the documented shortcut from a skip link.
JavaScript
const el = document.getElementById("skip-link");
console.log(el.ariaKeyShortcuts);
// HTML includes: aria-keyshortcuts="Alt+Shift+A"
Prefer ariaKeyShortcuts in script; keep the attribute for HTML markup.
Example 5 — Support Snapshot
Feature-detect and remember the author-implement rule.
JavaScript
console.log({
supported: "ariaKeyShortcuts" in Element.prototype,
type: "string",
tip: "Documents shortcuts you implement — does not create handlers",
status: "Baseline Widely available (MDN)"
});
Element.ariaKeyShortcuts 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.ariaKeyShortcuts
String — reflects aria-keyshortcuts for author-implemented keyboard shortcuts.
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 ariaKeyShortcuts IDL — use setAttribute
No
ariaKeyShortcutsBaseline
Bottom line: Use ariaKeyShortcuts to document shortcuts you implement. Keep the string in sync with real keydown handlers. The property alone never activates the control.
Wrap Up
Conclusion
ariaKeyShortcuts reflects aria-keyshortcuts so you can document author-implemented keyboard shortcuts for assistive technologies. Pair the string with real key handling, and update both whenever the shortcut changes.
Use clear modifier+key naming (for example Alt+Shift+A)
Expose a visible hint when it helps sighted users too
Test with keyboard and assistive technology
❌ Don’t
Assume the attribute creates shortcut behavior
Document shortcuts that do nothing
Blindly override essential browser shortcuts
Leave stale strings after changing keymaps
Skip an accessible name on the control itself
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about ariaKeyShortcuts
Reflected aria-keyshortcuts string for documented keyboard shortcuts.
5
Core concepts
📄01
Get / set
on Element
Kind
📝02
String value
e.g. Alt+Shift+A
Type
🔍03
Documents only
you implement handlers
Rule
✅04
Baseline
widely available
Status
🎯05
Stay in sync
string + keydown
Pair
❓ Frequently Asked Questions
It reflects the aria-keyshortcuts attribute as a string, indicating keyboard shortcuts that an author has implemented to activate or give focus to an element.
No. MDN marks Element.ariaKeyShortcuts as Baseline Widely available (since October 2023). It is not Deprecated, Experimental, or Non-standard.
A string describing the shortcut(s), for example "Alt+Shift+A" or "Control+S". Multiple shortcuts can be space-separated in the attribute.
No. The property only documents shortcuts you already implement. You still need keydown (or similar) listeners that actually activate or focus the element.
Follow ARIA key shortcut naming (modifier keys plus a key, joined with +). Keep the documented string in sync with the real handler.
Yes. Reading and writing ariaKeyShortcuts updates the reflected aria-keyshortcuts attribute.
Did you know?
ARIA allows space-separated lists in aria-keyshortcuts, so one control can advertise more than one combination. Still implement every shortcut you list—or remove the ones you do not support.