title: Callback on the removal of an element from the DOM tree?
body: <p>If I have a DOM element which is dynamically added to the page, and then removed using jQuery's <code>$("#id").remove()</code>, is it possible to setup a callback, so when the element is removed, I can execute a custom action.</p>
  
  <p>I was thinking of monkey-patching jQuery's <code>remove()</code> method, so I can check the element's ID and if it matches the one I want, execute the callback, but I'm <strong>not sure how</strong>.</p>
  
  <p>Are there any better ways to do it? And how can I do it using monkey-patching? </p>
  
  <p><em>(I'm writing a greasemonkey script, and I can't change the underlying implementation)</em></p>