DOM event flow


<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?

Mar.13,2021

the following is always triggered because the event in button is bubbling


addEventListener the third parameter to learn about

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea9e20-46a11.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea9e20-46a11.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?