2016-09-30 12 views

回答

4

你正在尋找可能的內容:

$.fn.customRemove = function() { 
    $(this).remove(); 
    console.log('Element removed.'); 
}; 

$('.selector').customRemove(); // you will get the log automatically 
+0

可惜的是,這不是解決我的問題,我想要創建一個通用的監聽器來處理所有被刪除的元素(以標準方式),而不是手動破解原始代碼。 –