Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

Workshop  |  DHTML, HTML & CSS

ACCESSKEY Attribute | accessKey Property


Specifies the accelerator key for the object.

Syntax

HTML<ELEMENT ACCESSKEY = sAccessKey ... >
Scriptingobject.accessKey [ = sAccessKey ]

Possible Values

sAccessKey Character string that denotes an alphanumeric keyboard key.

The property is read/write with no default value.

Remarks

Pressing the ALT key plus the specified accelerator key sets the focus to that object on the page.

By default, the accessKey property sets focus to the object. In addition, some controls perform an action after receiving focus. For example, using accessKey on a button fires the onclick event, whereas using accessKey on a radio button fires the onclick event and toggles the checked property, visibly selecting or deselecting the control.

Example

The following example uses a combination of the LABEL object and the accessKey property to set focus on a text box. The rich text support in the LABEL object makes it possible to underline the designated accessKey.

Sample Code

<LABEL FOR="fp1" ACCESSKEY="1">#<U>1</U>: Press Alt+1 to set focus to textbox</LABEL>
<INPUT TYPE="text" NAME="T1" VALUE=text1 SIZE="20" TABINDEX="1" ID="fp1">

This feature requires Internet Explorer 4.0 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To


Does this content meet your programming needs? Write us!

Back to topBack to top

© 1998 Microsoft Corporation. All rights reserved. Terms of use.

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site