
The HTML accesskey attribute defines a shortcut key to activate/focus an element.
Note: The way of using the shortcut key is varying in different browsers:
Browser: | Windows | Mac |
Firefox | [Alt] [Shift] + accesskey | [Control] [Alt] + accesskey |
Chrome | [Alt] + accesskey | [Control] [Alt] + accesskey |
Safari | [Alt] + accesskey | [Control] [Alt] + accesskey |
Opera | Opera 15 or newer: [Alt] + accesskey | – |
Internet Explorer | [Alt] + accesskey | – |
Example:
<!DOCTYPE html>
<html>
<body>
<a href="https://lenadesign.org/svg-4/" accesskey="s">SVG tutorial</a><br>
<a href="https://lenadesign.org/javascript/" accesskey="j">JavaScript tutorial</a>
</body>
</html>
Output:
Enjoy coding!
Read also: