Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

HTML | accesskey Attribute

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The accesskey attribute in HTML is the keyboard shortcuts to activate/focus specific elements. The access key attribute is browser dependent. It may vary from browser to browser.
Supported Tags: It supports all HTML elements. 


<element accessKey = "single_character">

Shortcut to use access key: The table describes the shortcut to use access key. 

Google ChromeAlt + single_characterCommand + Alt + single_characterAlt + single_character
Mozilla FirefoxAlt + Shift + single_characterCommand + Alt + single_character (On Firefox 14 or newer)
Command + single_character (On Firefox 13 or older)
Alt + Shift + single_character
Internet ExplorerAlt + single_characterN/AN/A
SafariAlt + single_characterCommand + Alt + single_characterN/A
Opera 15+Alt + single_characterCommand + Alt + single_characterAlt + single_character


  • In HTML4.1, the accesskey attributes can be used with only few elements which include <a>, <area>, <button>, <input>, <label>, <legend>, and <textarea>.
  • In HTML5, the accesskey attribute can be used with any element.


The behavior of the browser differs when dealing with more than one element having the same accesskey:


  • Google Chrome and Safari: The last element with the accesskey will be activated
  • Opera: The first element with the accesskey will be activated
  • Internet Explorer and Mozilla Firefox: The next element with the accesskey will be activated



<!DOCTYPE html>
            accesskey attribute
    <body style = "text-align:center">
        <h2>HTML accesskey attribute</h2>
        <!-- The accesskey attribute used here -->
        <a href=""
            accesskey = "g">GeeksforGeeks

Before using the access key: 


After using the access key: 

Supported Browsers: The browser supported by accesskey attribute are listed below: 

  • Google Chrome
  • Edge 12 and above
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


My Personal Notes arrow_drop_up
Last Updated : 20 Jul, 2022
Like Article
Save Article
Similar Reads
Related Tutorials