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

Related Articles

Web HTMLElement API | Element accessKeyLabel property

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

In Web API there are elements which have accesskey attribute. To fetch this accesskey attribute we use HTMLElement.accessKeyLabel property, which returns a String assigned to the accesskey attribute of the element.


label = element.accessKeyLabel

Note: If the accesskey attribute value is not provided then it returns an empty String.

Example: Height attribute set to 300

<!DOCTYPE html>
        a:focus {
            background-color: magenta;
    <script type="text/javascript">
        function getaccesskey() {
            var label = document.getElementById('btn');
              'access').innerHTML = 
        <h1 style="color:green;">  
        <h2>HTML Element accessKeyLabel property</h2>
        <button accesskey="g"
          Get accessKeyLabel
        <p id='access'></p>


Click the button:

When the button is clicked:

Supported Browsers:

  • Firefox 8

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