OnkeypressIt occurs when the user presses and releases any alphanumeric key. System buttons (for example, arrow keys and function keys) cannot be identified. OnkeyupIt occurs when the user releases any previously pressed keyboard keys. OnkeydownIt occurs when you press any keyboard key (including system buttons, such as the Arrow keys and function keys. Onkeypress As of Microsoft & reg; Internet Explorer 4.0, the onkeypress event fires and can be canceled for the following keys: Letters: A-Z (uppercase and lowercase) Numerals: 0-9 Symbols :! @ # $ % ^ & * () _-+ = <[] {},./? \ | ''"~ System: ESC, SPACEBAR, ENTER Onkeydown As of Microsoft & reg; Internet Explorer 4.0, the onkeydown event fires for the following keys: Editing: DELETE, INSERT Function: F1-F12 Letters: A-Z (uppercase and lowercase) Navigation: HOME, END, left arrow, right arrow, up arrow, DOWN ARROW Numerals: 0-9 Symbols :! @ # $ % ^ & * () _-+ = <[] {},./? \ | ''"~ System: ESC, SPACEBAR, SHIFT, TAB As of Internet Explorer 5, the event also fires for the following keys: Editing: BACKSPACE Navigation: page up, PAGE DOWN System: SHIFT + TAB As of Internet Explorer 5, this event can be canceled for the following keys and key combinations by specifying event. returnValue = false: Editing: BACKSPACE, DELETE Letters: A-Z (uppercase and lowercase) Navigation: page up, page down, END, HOME, left arrow, right arrow, up arrow, DOWN ARROW Numerals: 0-9 Symbols :! @ # $ % ^ & * () _-+ = <[] {},./? \ | ''"~ System: SPACEBAR, ESC, TAB, SHIFT + TAB You can cancel all keys that fire the onkeydown event in HTML Applications, including most accelerator keys, such as ALT + F4. In Internet Explorer 4.0, you cannot cancel the onkeydown event, but you can use the onkeypress event to cancel keyboard events. You can press the two together as follows: If (window. event. shiftKey & event. keyCode = xx) Function document_onpress () { If (event. keyCode = '13 ') { Document. all. div_Line.style.pixelLeft = document. all. div_Line.style.pixelLeft + 1; Document. all. div_Q.style.pixelLeft = document. all. div_Q.style.pixelLeft + 1; Document. all. div_T.style.pixelLeft = document. all. div_T.style.pixelLeft + 1; } |