Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM accessKey property

HTML DOM accessKey property

Element Object Reference Element object


Definition and Usage

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

Note: Please use the Alt + accessKey Give focus to the element with the specified shortcut key.

Syntax

HTMLElementObject.accessKey=

accessKey


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the accessKey property


Example

Example

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

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>

Runoob Tutorial(runoob.com)

title

<

script

function accesskey(){   document.getElementById('runoob').accessKey="r"   document.getElementById('g').accessKey="g" }

script

head

<body onload="accesskey()">
<a id="runoob" href="//www.runoob.com/">

Runoob Tutorial

a

<br>
<a id="g" href="//www.google.com/" Google a>
<p>
<b>

Note:

b

Use Alt +

<

i

accesskey

i

Access the element with the specified access key.

p

body

html

Try it »


Element Object Reference Element object