event.isPropagationStopped()
Returns whether event.stopPropagation() was ever called on this event object.
.event.isPropagationStopped()🡢 Boolean
This event method is described in the W3C DOM Level 3 specification.
Checks whether event.stopPropagation() was called
JS
<button>click me</button>
<div id="stop-log"></div>
HTML
function propStopped(event) {
var msg = "";
if (event.isPropagationStopped()) {
msg = "called";
} else {
msg = "not called";
}
$("#stop-log").append("<div>" + msg + "</div>");
}
$("button").click(function (event) {
propStopped(event);
event.stopPropagation();
propStopped(event);
});
DEMO