Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Specifies the accelerator key for the object.
Syntax
HTML <ELEMENT ACCESSKEY = sAccessKey ... > Scripting object.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">
Applies To
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.