Hello! Thanks a lot for module!
I have code how:
delegate('.container', '.item', 'click', (e) => {
// some actions
});
delegate('.container', '.link', 'click', (e) => {
e.preventDefault();
e.stopPropagation();
// some actions
});
And html:
<div class="container">
<div class="item">
<a href="#" class="link">click 1</a>
</div>
<div class="item">
<a href="#" class="link">click 2</a>
</div>
<div class="item">
<a href="#" class="link">click 3</a>
</div>
</div>
And when I click on the link the parent clickItem function fires
Hello! Thanks a lot for module!
I have code how:
And html:
And when I click on the link the parent clickItem function fires