Web/API/Event/cancelBubble

From Get docs
< Web/API‎ | Event


The cancelBubble property of the Event interface 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;

Value

A Boolean.

Example

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

Specifications

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
cancelBubble

Chrome Full support Yes

Notes'

Full support Yes

Notes'

Notes' Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.

Edge

Full support 12

Firefox Full support 53

Notes'

Full support 53

Notes'

Notes' Prior to Firefox 53, this property was defined on the UIEvent interface. See bug 1298970 for more details.

IE

Full support Yes

Opera Full support Yes

Notes'

Full support Yes

Notes'

Notes' Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.

Safari

Full support Yes

WebView Android Full support Yes

Notes'

Full support Yes

Notes'

Notes' Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.

Chrome Android Full support Yes

Notes'

Full support Yes

Notes'

Notes' Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.

Firefox Android Full support 53

Notes'

Full support 53

Notes'

Notes' Prior to Firefox 53, this property was defined on the UIEvent interface. See bug 1298970 for more details.

Opera Android Full support Yes

Notes'

Full support Yes

Notes'

Notes' Starting with Chrome 58 and Opera 45, setting this property to false does nothing, as per spec discussion.

Safari iOS

Full support Yes

Samsung Internet Android Full support Yes

Notes'

Full support Yes

Notes'

Notes' Starting with Samsung Internet 7.0 and Opera 45, setting this property to false does nothing, as per spec discussion.

Legend

Full support  
Full support
See implementation notes.'
See implementation notes.