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. jQuery F.A.Q