accesskey Attribute:
Accesskey attribute is used in html forms and links. It provides the user to use keyboard keys for functions which are usually done by a mouse. Example: Like user clicks on links in a webpage using mouse , so with the help of accesskey user can use keyboard shortcuts to click on links. It depends on the browser whether it supports accesskey attribute or not.
There are different shortcut keys for different browsers and they are as follow:
Browser |
Windows |
Linux |
|
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 |
|
N/A |
|
[Control] [Alt] + accesskey |
|
Opera |
Opera 15 or newer: [Alt] + accesskey
Opera 12.1 or older: [Shift] [Esc] + accesskey |
|
|
Example:
<!DOCTYPE html>
<html>
<body>
<nav>
<ul>
<li><a href="http://www.facebook.com" accesskey="f">Facebook</a></li>
<li><a href="http://www.yahoo.com" accesskey="y">Yahoo</a></li>
<li><a href="http://www.gmail.com" accesskey="g">Gmail</a></li>
</ul>
</nav>
</body>
</html>
In the above example in navigation links there are different accesskey are used for different links.
0 Comment(s)