Last Updated: February 25, 2016
·
693
· stvedt

Event Delegation with jQuery

Assign event handlers to a parent element and use target to determine what triggered the event. This will help prevent events from not firing when content is dynamically changed after the event handler has be created.

Full Blog Post

1 Response
Add your response

I've made a simple benchmark, which demonstrates how fast the .on method is.

http://jsperf.com/jb-jquery-events

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside