IE support for stopPropagation()
is lacking, and requires workarounds, but I can't tell if the same thing is true for stopImmediatePropagation()
- is it safe for all browsers, or does it requires its own set of workarounds?
stopImmediatePropagation() The stopImmediatePropagation() method of the Event interface prevents other listeners of the same event from being called. If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
stopImmediatePropagation() method stops the rest of the event handlers from being executed. This method also stops the event from bubbling up the DOM tree.
I was wondering for the browser support of JavaScript's event.stopImmediatePropagation
as well, so I decided to test it by checking whether the following method exists:
Event.prototype.stopImmediatePropagation
It's supported on the following desktop browsers:
stopImmediatePropagation
)The stopPropagation mentioned on the other answer is related to the method natively available on browser for the event
object , while the stopPropagation()
method of jQuery works fine in all browser (since it's a wrapper for the same task, taking into account the browser capabilities in which this method is run)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With