Provides a destroyed event on an element.
The destroyed event is called when the element is removed as a result of jQuery DOM manipulators like remove, html, replaceWith, etc. Destroyed events do not bubble, so make sure you don't use live or delegate with destroyed events.
$(".foo").bind("destroyed", function(){
//clean up code
})