Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project









ATTRIBUTE:  accesskey

accesskey="character"
 
The accesskey attribute allows you to designate a character on the keyboard that when pressed, along with the alt or meta key, will bring focus to an HTML element. By focus, we mean that the cursor will go to that element (for example, a link or an input box in a form).
 
The character can be any single character on the keyboard, including upper and lower case alphabets, numbers, symbols, or punctuation marks. You cannot repeat a character since each accesskey must uniquely identify an element.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DevGuru XHTML accesskey attribute example</title>
</head>
<body>
<form>
Simultaneously press the alt and 1 buttons and the cursor goes to the First Name input box.
<br />
Simultaneously press the alt and 7 buttons and the cursor goes to the Last Name input box.
<br />
Simultaneously press the alt and r buttons and the cursor goes to the Maiden Name input box.
<br />
<hr />
<br />
First Name: (accesskey = 1)
<br />
<input type="text" name="firstlname" size="30" accesskey="1" />
<br />
Last Name: (accesskey = 7)
</br>
<input type="text" name="lastname" size="30" accesskey="7" />
<br />
Maiden Name: (accesskey = r)
<br />
<input type="text" name="maidenname" size="30" accesskey="r" />
</form>
</body>
</html>

 
Output:
Click to see and test output in separate window


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information