Trigger event for Input tag content change

Source: Internet
Author: User

1. The difference between the onchange event and the Onpropertychange event:

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

2. The difference between the Oninput event and the Onpropertychange event:

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

3. Oninput and Onpropertychange failure conditions:

Oninput Event:

(1) When the value is changed in the script, it will not be triggered;

(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.

Trigger event for Input tag content change

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.