×

Save Your Code

If you click the save button, your code will be saved, and you get an URL you can share with others.

By clicking the "Save" button you agree to our terms and conditions.

Report Error

×

Save to Google Drive

If you have a Google account, you can save this code to your Google Drive.

Google will ask you to confirm Google Drive access.

×

Open from Google Drive

If you have saved a file to Google Drive, you can open it here:

Result Size: 625 x 571
x
 
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("div").click(function(event){
    alert("Event handler 1 executed");
      event.stopImmediatePropagation();
  });
  $("div").click(function(event){
    alert("Event handler 2 executed");
  });
  $("div").click(function(event){
    alert("Event handler 3 executed");
  });
});
</script>
</head>
<body>
<div style="height:100px;width:300px;padding:10px;border:1px solid blue;background-color:lightblue;">Click on this div element.</div>
<p>The second and third click event will not be executed due to event.stopImmediatePropagation(). Try to erase this method and see what happens.
 
</body>
</html>
×

Report a Problem: