Latest web development tutorials

HTML Global accesskey attribute

HTML Global Attributes HTML Global Attributes

Examples

Hyperlink with the specified shortcuts:

<a href="http://www.w3cschool.cc/html5" accesskey="h"> HTML5 </a> <br>
<a href="http://www.w3cschool.cc/css3" accesskey="c"> CSS3 </a>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the accesskey attribute


Definition and Usage

accesskey attribute specifies activate (enable element receives the focus) shortcut key elements.

Different in different in different operating systems access the browser shortcut key ways: Note:

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 browser shortcut key can be set to another set of combinations.

Tip: a variety of browsers accesskey shortcuts to use:

IE browser

Hold down the Alt key, click accesskey defined shortcuts (the focus will move to the link), and press Enter.

FireFox browser

Hold down Alt + Shift key and click accesskey defined shortcuts.

Chrome browser

Hold down the Alt key, click accesskey defined shortcuts.

Opera browser

Hold down the Shift key, click esc, appears accesskey list of shortcuts defined on this page to choose from.

Safari browser

Hold down the Alt key, click accesskey defined shortcuts.


Differences between HTML 4.01 and HTML5

In HTML5, accesskey attribute can be used with any HTML element (it will verify that any HTML element, but not necessarily useful).

In HTML 4.01, accesskey attribute can be used: <a>, <area>, <button>, <input>, <label>, <legend>, and <textarea>.


grammar

<Elementaccesskey = "character">

Property Value

value description
character Shortcuts specify an activation element


HTML Global Attributes HTML Global Attributes