javascript - How expensive is listening for events on the entire document? -


i want use event delegation on number of buttons in page of html. these buttons on page, , wondering how expensive listen entire document on click events, , have on click events trigger event delegation handler. more expensive having listeners on each of 20+ buttons (it can grow on 100 buttons, yes silly)?

i don't see how more expensive since listening clicks on document object instead of 25 anchor objects. said, 25-30 buttons not resource-intensive don't need worry this.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -