There is a difference between onkeypress and onkeydown. The differences between onkeypress and onkeydown are described below. The onkeypress event occurs when the user presses and releases any alphanumeric key. However, system buttons (such as arrow keys and function keys) cannot be identified. The onkeydown event occurs when you press any keyboard key (including system buttons. Specific differences: 1. An onkeydown occurs before onkeypress. 2. onkeypress does not support system buttons. 2. the keycode captured by onkeydown is not distinguished by letter size, but by onkeypress. Onkeypress occurs when the user presses and releases any alphanumeric key. System buttons (for example, arrow keys and function keys) cannot be identified. Onkeyup occurs when the user releases any previously pressed keyboard keys. Onkeydown occurs when you press any keyboard key (including system buttons, such as the Arrow keys and function keys. Detailed source reference: http://www.jb51.net/article/32600.htm