Differences between onkeypress and onkeydown

Source: Internet
Author: User
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

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.