The accesskey global attribute provides a hint for generating a keyboard shortcut for the current element. The attribute value must consist of a single printable character (which includes accented and other characters that can be generated by the keyboard).

Note: In the WHATWG spec it says you can specify multiple space-separated characters, and the browser will use the first one it supports. However, this does not work in most browsers. In IE/Edge it will use the first one it supports without problems, provided there are no conflicts with other commands.

The way to activate the accesskey depends on the browser and its platform:

  Windows Linux Mac
Firefox Alt + Shift + key On Firefox 57 or newer, Control +  Option + key -OR- Control + Alt + key
On Firefox 14 or newer, Control + Alt + key
On Firefox 13 or older, Control + key
Internet Explorer Alt + key N/A
Google Chrome Alt + key Control + Alt + key
Safari Alt + key N/A Control + Alt + key
Opera 15+ Alt + key Control + Alt + key
Opera 12

Shift + Esc opens a contents list which are accessible by accesskey, then, can choose an item by pressing key

Note that Firefox can customize the required modifier key by user's preferences.

Accessibility concerns

In addition to poor browser support, there are numerous concerns with the accesskey attribute:

  • An accesskey value can conflict with a system or browser keyboard shortcut, or assistive technology functionality. What may work for one operating system, assistive technology and browser combination, may not work with others.
  • Certain accesskey values may not be present on certain keyboards, especially when internationalization is a concern. So adpating to specific languages could cause further problems.
  • accesskey values that rely on numbers may be confusing to individuals experiencing cognitive concerns. From the situation where numerical values don't have a logical association with the functionality it triggers. 
  • Informing the user that accesskeys are present, so that they are aware of the functionality. Without a method of notifying this information, accesskeys may be accidentally activated.

Because of these issues, it is generally advised not to use accesskeys for most general-purpose websites and web apps.

Specifications

Specification Status Comment
HTML 5.2
The definition of 'accesskey' in that specification.
Recommendation More realistic behavior described for what is implemented in reality.
HTML Living Standard
The definition of 'accesskey' in that specification.
Living Standard No change from latest W3C HTML 5.1 spec.
HTML 5.1
The definition of 'accesskey' in that specification.
Recommendation No change from HTML5.
HTML5
The definition of 'accesskey' in that specification.
Recommendation From HTML 4.01 Specification, several characters can now be set as the accesskey. Also, it can be set on any element.
HTML 4.01 Specification
The definition of 'accesskey' in that specification.
Recommendation Only supported on <a>, <area>, <button>, <input>, <label>, <legend> and <textarea>

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge Full support YesFirefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support

See also

Document Tags and Contributors

Last updated by: devinea2,