--- title: Event.cancelBubble slug: Web/API/Event/cancelBubble translation_of: Web/API/Event/cancelBubble ---
{{APIRef("DOM Events")}}
Event.cancelBubble 속성은 {{domxref("Event.stopPropagation()")}}의 별칭입니다. 이벤트 핸들러에서 반환되기 전에 값을 true로 설정하면 이벤트가 전파되지 않습니다.
Syntax
event.cancelBubble = bool; var bool = event.cancelBubble;
elem.onclick = function(e) { // do cool things here e.cancelBubble = true; }
Specification | Status | Comment |
---|---|---|
{{SpecName('DOM WHATWG', '#dom-event-cancelbubble', 'cancellBubble')}} | {{Spec2('DOM WHATWG')}} |
{{Compat("api.Event.cancelBubble")}}