jQuery 1.3 introduced a new feature called live event binding which simplifies attaching event handlers to existing elements as well as future elements. This is very useful because using the older bind() function attaches event-handlers only to those elements that are present in the DOM at the time the event is bound. With live(), you can write your event binding once and have it automatically attached to dynamically inserted elements.
Related Submissions:
- jQuery Special Events The jQuery special events API is a fairly flexible system by which you can specify bind and unbind hooks as well as default actions for...
- Demystifying jQuery .live Live is kind of an odd method. Most people use it mostly for binding an event to a element injected in the DOM in a...
- jQuery Create Event Add a “create” event to jQuery, allowing you to execute logic when matches elements are inserted into the DOM. ...
- Custom outerClick event A custom event that fires when you click outside of the element the event handler has been attached to. You can use this to hide...
- Working with Events, Part 3: More Event Delegation with jQuery Event delegation, as described in the first article of this series, is a way to take advantage of event bubbling to avoid binding an event...