Latest web development tutorials

HTML DOM accessKey property

Elements Object Reference Element object


Definition and Usage

accessKey property sets or returns the radio button to access shortcuts.

Note: Use Alt + accessKey gives focus to the element has designated shortcuts.

grammar

HTMLElementObject.accessKey=accessKey


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support accessKey property


Examples

Examples

The following example returns the radio button shortcuts:

<html>
<head>
<script>
function accesskey()
{
document.getElementById('w3s').accessKey="w"
}
</script>
</head>

<body onload="accesskey()">

<a id="w3s" href="http://www.w3cschool.cc/">W3Cschool</a>

</body>
</html>

try it"


Elements Object Reference Element object