HTML: the accesskey attribute

The accesskey attribute assigns a keyboard shortcut to an interactive element such as a link or button.

What you will learn

Minimal example

<a href="/help.html" accesskey="h">Help</a>
<button type="button" accesskey="s">Save</button>

The value identifies the key associated with the element. The browser combines it with a modifier key, but the exact combination depends on the browser, operating system, and user settings.

Why caution is important

Good practice