Interview Questions

Why doesn't an event work on a new element I've created?

jQuery Interview Questions and Answers


(Continued from previous question...)

Why doesn't an event work on a new element I've created?

As explained in the previous question about AJAX, events are bound only to elements that exist at the time when you issue your initial jQuery call. When you create a new element, you must bind the event to it separately, or use event delegation.

(Continued on next question...)

Other Interview Questions