Better HN
topnewbestaskshowjobs
Log inSign up

donoftime

8 karma · joined Oct 29, 2023 (3y ago) · 1 submissions

Submissions

comment 2y ago · link · parent

I did not see mention of event delegation in the article.

Registering thousands of event handlers on one screen can have performance impact, and is generally why registering them on individual elements becomes a problem for an interactive page. Registering on a parent element can provide the same interactivity with only a single handler thanks to event bubbling.

https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Bu...