Jquery - Perform callback after append
问题 I am appending content to a list using: $('a.ui-icon-cart').click(function(){ $(this).closest('li').clone().appendTo('#cart ul'); }); I want to perform further functions to the appended content (change class, apply animations etc) How can I perform a callback on this function that will allow me to perform functions on the appended data? 回答1: jQuery's .each() takes a callback function and applies it to each element in the jQuery object. Imagine something like this: $('a.ui-icon-cart').click