How to specify click event as capture? Currently, it looks like it is bubbling.
In the onclick() function below, I need to always get the parent from the “e.target” object whether I click on “exit” or “Click here to”.
<div id="parent" @click=${onclick}>
Click here to <span id="child">exit</span>
</div>
<script>
export default () => {
const onclick = (e) => {
//how to set event handler as capture so this would always give the parent element?
console.log(e.target);
}
});
</script>