CKTIS / HTML
HTML term or value: accesskey
The `accesskey` attribute supplies keyboard-shortcut candidates for an element, but the browser, operating system, and keyboard layout decide the actual key combination.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
<button accesskey="s">Save</button>accesskey is a global attribute whose value is an ordered set of single-character tokens. The accessKey property reflects the value selected for the element; the attribute itself adds no role, focusability, or activation behavior.
The token s can be a candidate for a Save button, but the author cannot choose the modifier. accessKeyLabel is not a portable way to display a ready-made combination because implementations may not expose it.
Use shortcuts sparingly: they can conflict with browser, system, screen-reader, or editor commands, depend on language and physical keyboard layout, and are difficult to discover. A visible way to perform the action must remain available.
The accesskey="s" example reads accessKey and the accessKeyLabel boundary; undefined in this Chromium documents the absence of a portable label, not the absence of the candidate token. The test does not synthesize an operating-system shortcut.
Examples
<!doctype html><meta charset="utf-8"><button id="x" accesskey="s">Save</button><output id="result"></output><script>result.textContent=`key=${x.accessKey}; label=${x.accessKeyLabel}`;</script>Result
key=s; label=undefined
The executed example verifies token reflection and the environment-specific label boundary; it does not claim that a particular keyboard shortcut was assigned.