'Why on IE 8 that a change event on input is not propagated to the form element?
I thought a change event would propagate from the input element to the form element in general?
On Chrome, it works: http://jsfiddle.net/gjatW/13/
But on IE 8, no console.log
will be invoked: http://fiddle.jshell.net/gjatW/13/show/
(note that we have to type something and focus out of the input box for the change
event to fire, rather than individual keystroke)
(we have to use the jshell.net to look at the resultant frame, because IE 8 doesn't render jsfiddle.net correctly).
Further details:
If we bind it on the input
element, then we see the console.log
on both Chrome and IE 8:
http://jsfiddle.net/gjatW/12/
http://fiddle.jshell.net/gjatW/12/show/
If using jQuery, then it works on both Chrome and IE 8 even if we bind on the form element. But the question is, I thought IE 8 supports bubbling, so why is the change event not bubbled to the form element if we are using DOM level 0 onchange
handler?
http://jsfiddle.net/gjatW/10/
http://fiddle.jshell.net/gjatW/10/show/
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|