<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>点击事件捕获冒泡</title>
</head>
<body>
<div id="grandPa">
<div id="father">
<div id="son">
<input type="button" value="click" draggable="true"/>
</div>
</div>
</div>
<script type="text/javascript">
var grandPa = document.getElementById('grandPa');
grandPa.addEventListener('click',function () {
alert('grandPa');
})
var father = document.getElementById('father');
father.addEventListener('click',function () {
alert('fattther');
})
var son = document.getElementById('son');
son.addEventListener('click',function () {
alert('son');//最里层div
});
</script>
</body>
</html>