Several events trigger input

--- --- restore content begins

1. onchange event onpropertychange event of differences:

 onchange event content changes (equal to twice the content is possible) and the trigger loses focus;

   onpropertychange events are triggered in real-time, add or delete a character every triggered by js change will trigger the event, but the event is IE specific.

2. oninput events onpropertychange event of differences:

   oninput event is supported by most browsers events other than IE, only when the value changes in real-time triggering, but will not trigger value through js change; when you select from the drop down automatically, does not trigger, through addEventListener () to registered

   onpropertychange event is any property change triggers, onpropertychange registration method with the same general event, when the input is set to disable = true, does not trigger

--- end --- restore content

Guess you like

Origin www.cnblogs.com/mpl9/p/11458167.html