Home > Article > Web Front-end > JQuery live函数_jquery
Excerpted from jQuery 1.4.1 Chinese reference:
Event Delegate
The.live() method works on an element that has not yet been added to the DOM due to the use of event delegation: event handlers bound to ancestor elements can respond to events triggered on descendants. The event handler passed to .live() will not be bound to the element, but will be treated as a special event handler and bound to the root node of the DOM tree. In our example, when a new element is clicked, the following steps occur:
Since the test in step 5 above is only done when the event occurs, elements added at any time can respond to this event