Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Global accesskey Attribute

The HTML accesskey attribute

HTML Global Attributes HTML Global Attributes

Example

A hyperlink with a specified access key:

<a href="//www.runoob.com/html/html-tutorial.html" accesskey="h">

HTML Tutorial

a

<br>
<a href="//www.runoob.com/css/css-tutorial.html" accesskey="c">

CSS Tutorial

a

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the accesskey attribute


Definition and Usage

The accesskey attribute specifies a shortcut key to activate (focus) an element.

Note: The way to access access keys differs among browsers on different operating systems:

Browser Windows Linux Mac
Internet Explorer [Alt] + accesskey N/A
Chrome [Alt] + accesskey [Alt] + accesskey [Control] [Alt] + accesskey
Firefox [Alt] [Shift] + accesskey [Alt] [Shift] + accesskey [Control] [Alt] + accesskey
Safari [Alt] + accesskey N/A [Control] [Alt] + accesskey
Opera Opera 15 or newer: [Alt] + *accesskey
*Opera 12.1 or older: [Shift] [Esc] + accesskey

However, in most browsers the shortcut can be set to a different combination.

Tip: How to use accesskey shortcuts in various browsers:

IE browser

Hold down the Alt key, click the shortcut defined by accesskey (the focus will move to the link), then press Enter.

Firefox browser

Hold down the Alt+Shift keys and click the shortcut defined by accesskey.

Chrome browser

Hold down the Alt key and click the shortcut defined by accesskey.

Opera browser

Hold down the Shift key and click esc; a list of accesskey shortcuts defined for this page appears for selection.

Safari browser

Hold down the Alt key and click the shortcut defined by accesskey.


Differences between HTML 4.01 and HTML5

In HTML5, the accesskey attribute can be used on any HTML element (it will validate any HTML element, but it may not be useful).

In HTML 4.01, the accesskey attribute can be used on: , ,