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

查看:32
本文介绍了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?

谷歌搜索未能找到决定性的答案.

Googling has failed in finding a conclusive answer.

推荐答案

根据规范changesubmitreset 应该冒泡,focusblur 不应该冒泡.

According to specification, change, submit, reset should bubble and focus and blur should not bubble.

此行为在除 IE < 之外的所有 Web 浏览器中都正确实现.9、即changesubmitreset在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

这篇关于onchange 事件是否传播?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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