onkeydownonkeydown*
*Contents  *Index  *Topic Contents
*Previous Topic: onhelp
*Next Topic: onkeypress

onkeydown

Description

Fires when the user presses a key.

Return Value

Returns a number specifying the keycode of the key that was pressed.

Remarks

The return value can be used to override the keycode value. This event will bubble. Events that bubble can be handled on any parent element of the object that fired the event.

To cancel the keystroke, use the following code in the onkeydown event:

event.returnValue=false;

Applies To

A, ACRONYM, ADDRESS, APPLET, AREA, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, DD, DEL, DFN, DIR, DIV, DT, EM, FIELDSET, FONT, FORM, H1, H2, H3, H4, H5, H6, HR, I, IMG, INPUT, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, OBJECT, OL, P, PLAINTEXT, PRE, Q, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP, document


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.