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.
Written by Stephen Tvedt
Related protips
1 Response
I've made a simple benchmark, which demonstrates how fast the .on method is.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#