This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Event.cancelBubble

Deprecated

Avoid using this feature in new projects. This feature may be a candidate for removal from web standards or browsers.

Event.cancelBubble 속성은 Event.stopPropagation()의 별칭입니다. 이벤트 핸들러에서 반환되기 전에 값을 true로 설정하면 이벤트가 전파되지 않습니다.

예제

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

명세

Specification
DOM
# dom-event-cancelbubble

브라우저 호환성