实例代码“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
  $("h1,h2,p").click(function(event){
9
   alert(event.currentTarget === this);
10
 });  
11
});
12
</script>
13
</head>
14
<body>
15
16
<h1>Heading 1</h1>
17
<h2>Heading 2</h2>
18
<p><b>Note:</b> Click on each HTML element. The currentTarget is typically equal to "this", and will return "true".</p>
19
20
</body>
21
</html>