<div><button></button></div>
btn.addEventListener("click", function(){
console.log("btn");
},false);
div.addEventListener("click", function(){
console.log("div");
}, false);
There is no problem with the capture and bubbling of events in the code
above.
<div onclick = "javascript:console.lg("div")">
<button></button>
</div>
btn.addEventListener("click", function(){
console.log("btn");
},false);
< hr >
the code above
div event is always triggered? Why is that?