代码如下所示:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="div2">
<div id="div1">点我</div>
</div>
<script type="text/javascript">
var div2=document.getElementById('div2');
var div1=document.getElementById('div1');
div1.addEventListener('click', function(event){console.log("A");}, true);
div2.addEventListener('click', function(event){console.log("B");});
div1.addEventListener('click', function(event){console.log("C");}, false);
div2.addEventListener('click', function(event){console.log("D");}, true);
</script>
</body>
</html>
当点击 点我 时,为什么输出结果是DACB????
评论邀请回答编辑
ibeautiful
相关分类