Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. HTML
  3. Reference
  4. Global attributes
  5. accesskey

HTML accesskey global attribute

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

Theaccesskeyglobal 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).

Try it

<p>If you need to relax, press the <b>S</b>tress reliever!</p><button accesskey="s">Stress reliever</button>
b {  text-decoration: underline;}

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

WindowsLinuxMac
FirefoxAlt +Shift +keyControl +Option +key orControl +Alt +key
MS EdgeAlt +keyControl +Option +key
orControl +Option +Shift +key
Control +Option +key
Google Chrome
Safarin/aControl +Option +key
OperaAlt +keyControl +Alt +key

Accessibility concerns

There are numerous concerns with theaccesskey attribute:

  • Anaccesskey value can conflict with a system or browser keyboard shortcut, or assistive technology functionality. What may work for one combination of operating system, assistive technology, and browser may not work with other combinations.
  • Certainaccesskey values may not be present on certain keyboards, especially when internationalization is a concern. So adapting to specific languages could cause further problems.
  • accesskey values that rely on numbers may be confusing to individuals experiencing cognitive concerns, where the number doesn't have a logical association with the functionality it triggers.
  • Informing the user thataccesskeys are present, so that they are aware of the functionality. If the system lacks a method of notifying the user about this feature, the user might accidentally activateaccesskeys.

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

Specifications

Specification
HTML
# the-accesskey-attribute

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp