# 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>
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up