教程·Javascript 中文手册
Executes JavaScript code when a KeyDown event occurs; that is, when the user depresses a key.
| 事件适用对象 | Navigator 4.0 |
onKeyDown="handlerText"
| handlerText | JavaScript 代码或对一个 JavaScript 函数的调用。 |
| type | 标明了事件的类型。 |
| target | 标明了事件原来发送的对象。 |
| layerX, layerY, pageX, pageY, screenX, screenY |
For an event over a window, these represent the cursor location at the time the event occurred. For an event over a form, they represent the position of the form element. |
| which | Represents the ASCII value of the key pressed. To get the actual letter, number, or symbol of the pressed key, use the | Contains the list of modifier keys held down when the event occurred.
A KeyDown event always occurs before a KeyPress event. If onKeyDown returns false, no KeyPress events occur. This prevents KeyPress events occurring due to the user holding down a key.
要获得关于事件对象的信息,请看事件。