<body>
<div class="father">
<div class="son"></div>
</div>
<a href="https://www.baidu.com">我是百度</a>
</body>
JQuery.js
/*
1、什么是事件冒泡
2、如何阻止事件冒泡
3、什么是默认行为
4、如何阻止默认行为
*/
$(".son").click(function(event){
alert("son");
// return false;
event.stopPropagation();
})
$(".father").click(function(){
alert("father")
})
$("a").click(function(event){
alert("弹出")
// return false
event.preventDefault();
})