HTML accesskey attribute: The HTML accesskey attribute can be used as a shortcut to activate specific elements. And this accesskey attribute is a browser dependent. So, that it will be varying from browser to browser.
HTML accesskey attribute
While the accesskey attribute is a Global attribute. So, it can be used on any HTML element.
Syntax:<element accessKey = “single_character”>
Let us see how the shortcut can be used in a different browser as follows:
Chrome
If you are using chrome browser, you can follow these shortcuts in different software.
- Windows: If you are using windows software then, you should press [Alt] + accesskey
- Linux: If you are using Linux software then, you should press [Alt] + accesskey
- Mac: If you are using Mac software then, you should press [Control] [Alt] + accesskey
Firefox
If you are using Firefox browser, you can follow these shortcuts in different software.
- Windows: If you are using windows software then, you should press [Alt] [shift]+ accesskey
- Linux: If you are using Linux software then, you should press [Alt] [Shift] + accesskey
- Mac: If you are using Mac software then, you should press [Control] [Alt] + accesskey
Safari
If you are using Safari browser, you can follow these shortcuts in different software.
- Windows: If you are using windows software then, you should press [Alt] + accesskey
- Linux: Not present
- Mac: If you are using Mac software then, you should press [Control] + [Alt] + accesskey
Example:
<!DOCTYPE html> <html> <head> <title> accesskey attribute </title> </head> <body style = "text-align:center"> <h1>Freshersnow</h1> <h2>HTML accesskey attribute</h2> <!-- The accesskey attribute used here --> <a href="https://tutorials.freshersnow.com/" accesskey = "g">Freshersnow </a> </body> </html>
Output: