onchange事件是否传播? [英] Does the onchange event propagate?

查看:88
本文介绍了onchange事件是否传播?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用事件委托来监听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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆