实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js">
5
</script>
6
<script>
7
$(document).ready(function(){
8
  $("div").click(function(event){
9
  event.stopImmediatePropagation();
10
  alert("Was event.stopImmediatePropagation() called: " +  event.isImmediatePropagationStopped());
11
  });
12
});
13
</script>
14
</head>
15
<body>
16
17
18
<div style="height:100px;width:300px;padding:10px;border:1px solid blue;background-color:lightblue;">Click on this div element.</div>
19
20
</body>
21
</html>