accessKeyLabel

The HTMLElement.accessKeyLabel read-only property returns a String that represents the element's assigned access key (if any); otherwise it returns an empty string.

Syntax

label = element.accessKeyLabel

Example

JavaScript

var node = document.getElementById('btn1');
if (node.accessKeyLabel) {
  node.title += ' [' + node.accessKeyLabel + ']';
} else {
  node.title += ' [' + node.accessKey + ']';
}

node.onclick = function () {
  var p = document.createElement('p');
  p.textContent = 'Clicked!';
  node.parentNode.appendChild(p);
};

HTML

<button accesskey="h" title="Caption" id="btn1">Hover me</button>

Result

Specifications

Specification Status Comment
HTML Living Standard
The definition of 'HTMLElement.accessKeyLabel' in that specification.
Living Standard No change from initial definition.
HTML 5.1 Recommendation Removed. pull w3c/html#144issue w3c/html#99WICG discussion.
HTML5
The definition of 'HTMLElement.accessKeyLabel' in that specification.
Recommendation Snapshot of  HTML Living Standard, initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome ? Edge No support NoFirefox Full support 8IE ? Opera ? Safari ? WebView Android ? Chrome Android ? Edge Mobile No support NoFirefox Android Full support 8Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

Contributors to this page: fscholz, Krinkle
Last updated by: fscholz,