We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

这篇翻译不完整。请帮忙从英语翻译这篇文章

 

Event.cancelBubble 属性是 Event.stopPropagation()的一个曾用名。在从事件处理程序返回之前将其值设置为true可阻止事件的传播。

语法

event.cancelBubble = bool;
let bool = event.cancelBubble;

用例

ele.onclick = function(e) {
  // 在这儿可以做点儿有趣的事情 
  e.cancelBubble = true;
}

规范

这个属性的规范并未统一. 因为他还有其他标准 W3C版: an old Working Draft of W3C DOM Level 2. 微软版: description of it on MSDN.

浏览器兼容

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Firefox (Gecko) Chrome Edge Internet Explorer Microsoft Edge Opera Safari
Basic support 未实现 (Yes) (Yes) (Yes) (Yes) (Yes) (Yes)
Feature Firefox Mobile (Gecko) Android Edge IE Mobile Opera Mobile Safari Mobile
Basic support ? ? (Yes) ? ? ?

参考

文档标签和贡献者

标签: 
此页面的贡献者: shockw4ver, xgqfrms-GitHub, SuunZhu
最后编辑者: shockw4ver,