HTML accesskey Attribute
Example
Two hyperlinks with specified accesskeys:
<a href="https://www.w3schools.com/html/" accesskey="h">HTML</a><br>
<a href="https://www.w3schools.com/css/" accesskey="c">CSS</a>
Try it Yourself »
Definition and Usage
The accesskey attribute specifies a shortcut key to activate/focus an element.
The accesskey attribute value must be a single character (a letter or a digit).
Concerns
Using accesskeys may conflict with other standard keys in the browser. However, most browsers use accesskeys together with the Alt key.
Adapting accesskeys to all international languages are difficult. The accesskey value may not be present on all keyboards.
Because of these concerns, it is advised not to use accesskeys.
Syntax
<element accesskey="character">
| Value | Description |
|---|---|
| character | A single character that specifies the shortcut key to activate/focus the element |
Browser Support
| Attribute | |||||
|---|---|---|---|---|---|
| accesskey | Yes | Yes | Yes | Yes | Yes |
Related Pages
HTML Tutorial: HTML Attributes
HTML DOM reference: accessKey Property