DEV Community

Discussion on: help, i am stuck

Collapse
 
pthacker profile image
Pratik thacker

Hey brother, you are attaching a listener to every element which is alright but it is not efficient at all. Imagine you have 1000 elements and 1000 click listeners..what you can also try is Event bubbling or event propagation...If you do not understand these concepts , you can go through the following videos:
https://www.youtube.com/watch?v=aVSf0b1jVKk&t=348s

youtube.com/watch?v=3KJI1WZGDrg

Collapse
 
cmuralisree profile image
Chittoji Murali Sree Krishna

Thanks a lot brother, to be frank, I am seeing these kinds of topics for the first time,

Thanks again for sharing the information, I will definitely look into it.

Collapse
 
pthacker profile image
Pratik thacker

There is always first time.... someday even i heard it for the first time...