javascriptdom-eventsevent-bubblingevent-propagation

Does stopPropgation stop the event from propagating in the capture phase?


I was looking at http://www.quirksmode.org/js/events_order.html and it is ambiguous in this part:

In the Microsoft model you must set the event’s cancelBubble property to true.

window.event.cancelBubble = true

In the W3C model you must call the event’s stopPropagation() method.

e.stopPropagation()

This stops all propagation of the event in the bubbling phase.

So my question is:


Solution

  • No, an event listener doesn't stop any events from propagating, unless you explicitly tell it to. The part you're referring to deals with the bubble phase specifically. IE's model doesn't support event capturing - full stop. the capture phase is what precedes the bubbling phase:

    Top of the DOM --->event--->traverses--->to--->[target]+[event]-| (capture phase)
          /\                                                       \/
          |------------------------to--------back up-----------------  (bubble up)