📜  停止传播事件 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:11.908000             🧑  作者: Mango

代码示例1
$("span").click(function(event){
  event.stopPropagation();
  alert("The span element was clicked.");
});
$("p").click(function(event){
  alert("The p element was clicked.");
});
$("div").click(function(){
  alert("The div element was clicked.");
});