# Event capturing https://www.youtube.com/watch?v=eQOLcKZIPzA <body> <div class="parentbox" id='parentdiv'> <div class="childbox" id='childdiv'></div> </div> </body> <script> const parentdiv = document.getElementById('parentdiv'); const childdiv = document.getElementById('childdiv'); const parentCall=()=>{ alert("parent box call"); console.log("parent box call"); } const childCall =()=>{ alert("child box call"); console.log("child box call"); // event.stopPropagation(); } parentdiv.addEventListener('click', parentCall, true); childdiv.addEventListener('click', childCall, true); </script>