W3Schools.com

HTMLElement accessKey Property

HTMLElement Object Reference HTMLElement Object

Definition and Usage

The accessKey property sets or returns an accesskey for an element.

Note: Use Alt + accessKey to access the element with the specified access key.

Syntax

HTMLElementObject.accessKey=accessKey


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The accessKey property is supported in all major browsers.


Example

Example

Set the access key of a link:

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

<body onload="accesskey()">

<a id="w3s" href="http://www.w3schools.com/">W3Schools</a>

</body>
</html>

Try it yourself »


HTMLElement Object Reference HTMLElement Object
WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$3.98 Unlimited Hosting
Premium Website Design
WEB BUILDING
XML Editor - Free Trial!
FREE Website BUILDER
Best Website Templates Top CSS Templates
CREATE HTML Websites
EASY WEBSITE BUILDER
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE