Home >>jQuery Tutorial >jQuery event.isPropagationStopped() Method
jQuery event.isPropagationStopped() method in jQuery is used to verify whether event.stopPropagation() has been called for the event and it returns true if this method has been called, and false if not.
Syntax:event.isPropagationStopped()
Parameter | Description |
---|---|
event | It is a required parameter and is used to the event parameter comes from the event binding function |
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".box2").click(function(event){
event.stopPropagation();
alert("Was event.stopPropagation() called: " + event.isPropagationStopped());
});
});
</script>
</head>
<body>
<div class="box2" style="height:80px;width:150px;padding:5px;background-color:orange;">Click me :)</div>
</body>
</html>