Event: cancelBubble property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("DOM")}}{{AvailableInWorkers}}

The **cancelBubble** property of the {{domxref("Event")}} interface is deprecated. Use {{domxref("Event.stopPropagation()")}} instead. 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.

Value

A boolean value. The value true means that the event must not be propagated further.

Example

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}