Input label content to change or lose focus on the trigger event __javascript

Source: Internet
Author: User

The difference between the onchange event and the Onpropertychange event:

The onchange event is triggered when content changes (two times the content is likely to be equal) and loses focus; The Onpropertychange event is triggered in real time, each additional or deleted character is triggered, and the event is triggered by a JS change, but the event is IE proprietary.

The difference between the Oninput event and the Onpropertychange event:

The Oninput event is an event that is supported by most browsers outside IE and is triggered in real time when value changes, but is not triggered when the value is changed via JS; Onpropertychange event is triggered by any property change. But oninput only when value changes trigger, oninput to register through AddEventListener (), Onpropertychange registration method is the same as the general event.

Oninput and Onpropertychange failure:

Oninput Event:

(1) When the value is changed in the script, it does not trigger;

(2) When selected from the browser's automatic Drop-down prompt, does not trigger;

Onpropertychange Event:

When input is set to Disable=true, it is not triggered.

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.