Call function after element has been removed from DOM
<p>I'm using jQuery to attach a click event to a link that removes a a table row from the DOM. I need to call another function when the click event is fired. I tried using the jQuery <code>.on()</code> method but the function is not called. I see there is a <code>.trigger()</code> method I can use, but not sure how to best use.</p>

<p><strong>How can I call a function after element has been removed from DOM?</strong></p>

<p>Here is my code:
</p>

<pre><code>// Add the remove link and attach the remove click event
    $("[id$=types-cell]").append(function () {
        return $('&lt;a href="#" id="remove-link" class="remove"&gt;[X]&lt;/a&gt;')
            .click(function () {
                var cell = $(this).parent('td');
                cell.parent('tr').remove(); // Need to call function after tr is removed
            });
    });


   $(".remove").on("click", myFunction); // myFunction does not get called

   function myFunction(){
      ...
   }
</code></pre>
