Differences between onkeydown, onkeypress, onkeyup, onblur, onchange, oninput, and onpropertychange

Source: Internet
Author: User

Onkeydown: any key (letters, numbers, systems, tabs, etc.) can be triggered, and the letters are not case sensitive;

Onkeypress: triggered when the letter or number key is pressed, and the letters are case sensitive;

Onkeyup: The corresponding key and onkeydown are the same. The difference is that the order is different.

The corresponding order of the first three is: onkeydown ----> onkeypress -----> onkeyup

Bytes --------------------------------------------------------------------------------------------

Onblur: The mouse loses focus

Onfocus: The mouse gets the focus

Bytes --------------------------------------------------------------------------------------------

Onchange: triggered when the value changes and the mouse loses focus. It is not triggered when the value is changed through JS or select.

Onpropertychange

Oninput: Except for the onpropertychange in IE browser, the difference is that it is not triggered when the value is changed through JS or select.

Bytes -------------------------------------------------------------------------------------------

Mouseover/mouseout: each time you enter this area and move all the elements in this area, it is bound multiple times because of event bubbles.

Mouseenter/mouseleave: the trigger condition is the same as that of Mouseover/mouseout. The difference is that events do not bubble up and therefore do not be bound multiple times. Sadly, these two attributes are only supported by IE and opera.

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.