DEV Community

Discussion on: Simple Filters in CSS or JS

Collapse
 
asifurrahamanofficial profile image
Asifur Rahaman • Edited

Nice trick.
Can we use event bubbling instead of writing the onClick for every div?[1st method]

Collapse
 
dhintz89 profile image
Daniel Hintz

Hi Asifur, thanks for the suggestion. While I understand the basics of event bubbling, I have never really looked into how to beneficially implement it. I saw your article about it, so I'm going to try out the delegation approach here shortly. Sounds like a super useful trick!

Collapse
 
asifurrahamanofficial profile image
Asifur Rahaman

Yep 💥🤠