References

Beginner-friendly references for web development, with live, editable examples.

The HTML aria-keyshortcuts attribute

ARIA Accessibility All modern browsers Updated
Quick answer

The aria-keyshortcuts attribute lists the keyboard shortcuts that activate or focus an element, for example "Alt+Shift+P". It only announces the shortcut; you still have to implement the key handling yourself.

Overview

The aria-keyshortcuts attribute lists the keyboard shortcuts that activate or focus an element.

It is a widget property whose value is a space-separated list of key combinations, each joining its keys with +, for example Alt+Shift+P. It is exposed only to assistive technology and has no visual effect, and it does not implement the shortcut: you still have to handle the keystroke yourself.

Like all ARIA, aria-keyshortcuts changes only the accessibility tree (what assistive technology perceives), never the element's behavior or appearance. The first rule of ARIA applies: if a native HTML element or attribute conveys this, use that instead, and only reach for ARIA when nothing native fits.

Syntax

<button aria-keyshortcuts="Alt+S">Save</button>

Values

Value
A space-separated list of shortcuts, e.g. "Alt+Shift+P Control+."

Example

Live example
<button aria-keyshortcuts="Control+S">Save</button>

Best practices

  • Follow the first rule of ARIA: use a native HTML element or attribute that conveys this where one exists, rather than adding ARIA.
  • Write each combination with + between the keys, separating multiple shortcuts with spaces.
  • Implement the key handling yourself; the attribute only announces the shortcut.
  • Avoid clashing with the browser's own shortcuts and with assistive-technology key bindings.

Frequently asked questions

What does aria-keyshortcuts do?
Lists the keyboard shortcuts that activate or focus an element.
How do I write the value?
As one or more key combinations separated by spaces, each using + between modifier and key, for example Control+Shift+K.
Does it create the shortcut for me?
No. It only exposes the shortcut to assistive technology; you still have to implement the key handler.
Do I need aria-keyshortcuts if native HTML already conveys it?
Usually not. ARIA is for what native HTML cannot express; redundant or incorrect ARIA can make accessibility worse. Reach for it only when no native element fits.