Easy Tutorial
❮ Prop Password Name Dom Obj Label ❯

HTML DOM accessKey Property

Element Object


Definition and Usage

The accessKey property sets or returns the shortcut key for the radio button.

Note: Use Alt + accessKey to give focus to an element with the specified shortcut key.

Syntax


Browser Support

All major browsers support the accessKey property.


Example

The following example returns the shortcut key for the radio button:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<script>
function accesskey(){
  document.getElementById('tutorialpro').accessKey="r"
  document.getElementById('g').accessKey="g"
}
</script>
</head>
<body onload="accesskey()">

<a id="tutorialpro" href="//www.tutorialpro.org/">tutorialpro.org</a><br>
<a id="g" href="//www.google.com/">Google</a>
<p><b>Note:</b> Use Alt + <i> accesskey </i> to access the element with the specified access key.</p>

</body>
</html>

Element Object

❮ Prop Password Name Dom Obj Label ❯