W3cubDocs

/DOM

Event.cancelBubble

The Event.cancelBubble property is a historical alias to Event.stopPropagation(). Setting its value to true before returning from an event handler prevents propagation of the event. In later implementations, setting this to false does nothing. See Browser compatibility for details.

Syntax

event.cancelBubble = bool;
var bool = event.cancelBubble;

Example

elem.onclick = function(e) {
 // do cool things here
  e.cancelBubble = true;
}

Specifications

Specification Status Comment
DOM
The definition of 'cancelBubble' in that specification.
Living Standard

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support Yes
Yes
Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.
Yes 53
53
Prior to Firefox 53, this property was defined on the UIEvent interface. See bug 1298970 for more details.
Yes Yes
Yes
Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.
Yes
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support Yes
Yes
Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.
Yes
Yes
Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.
Yes 53
53
Prior to Firefox 53, this property was defined on the UIEvent interface. See bug 1298970 for more details.
Yes
Yes
Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.
Yes ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelBubble