jQuery API

event.isPropagationStopped()

event.isPropagationStopped() Returns: Boolean

Description: Returns whether event.stopPropagation() was ever called on this event object.

  • version added: 1.3event.isPropagationStopped()

This event method is described in the W3C DOM Level 3 specification.

Example:

Checks whether event.stopPropagation() was called

<!DOCTYPE html>
<html>
<head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
  
  <button>click me</button>
  <div id="stop-log"></div>
  
<script>

function propStopped(e) {
  var msg = "";
  if ( e.isPropagationStopped() ) {
    msg =  "called"
  } else {
    msg = "not called";
  }
  $("#stop-log").append( "<div>" + msg + "</div>" );
}

$("button").click(function(event) {
  propStopped(event);
  event.stopPropagation();
  propStopped(event);
});  
</script>

</body>
</html>

Demo:

Support and Contributions

Need help with event.isPropagationStopped() or have a question about it? Visit the jQuery Forum or the #jquery channel on irc.freenode.net.

Think you've discovered a jQuery bug related to event.isPropagationStopped()? Report it to the jQuery core team.

Found a problem with this documentation? Report it on the GitHub issue tracker

  • http://pulse.yahoo.com/_SHHG5WYPBBOICLV6RVTLZ2ZPFA Felipe

    It seems this method is no longer in the W3C DOM Level 3 specification.
    http://www.w3.org/TR/DOM-Level…/