实例代码“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
  $("p").click(function(){
9
    $("p").on("myPara", function(event, param1, param2, param3){
10
    alert(param1 + "\n" + param2 + "\n" + param3);
11
    });
12
  $("p").trigger("myPara", ['Pass', 'Along', 'Parameters']);
13
  });
14
});
15
</script>
16
</head>
17
<body>
18
19
<p>Click to alert additional parameters.</p>
20
21
</body>
22
</html>