onchange事件是否传播? [英] Does the onchange event propagate?
问题描述
我正在使用事件委托来监听DOM中较低的事件,但在选择框上的onchange事件不起作用。 onchange事件是否传播或冒泡DOM?
I'm using event delegation to listen for events lower in the DOM, but it's not working for an onchange event on a select box. Does the onchange event propagate or bubble up the DOM?
Google搜索失败找到一个确定的答案。
Googling has failed in finding a conclusive answer.
推荐答案
According to specification, "change", "submit", "reset" should bubble and "focus" and "blur" should not bubble.
此行为在除IE< 9,也就是改变,提交,重新设置IE> = 9.
This behavior is implemented properly in all web browsers except IE < 9, that is, change,submit,reset do bubble properly in IE >= 9.
请参阅 https://stackoverflow.com/a/4722246/227299 针对旧版IE的jQuery解决方法
See https://stackoverflow.com/a/4722246/227299 for a jQuery workaround on old IE versions
- http://www.quirksmode.org/dom/events/change.html
- http://quirksmode.org/dom/events/submit.html
这篇关于onchange事件是否传播?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!