jQuery.event.special.destroyed  attribute     

test: qunit.html

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.

Quick Example

$(".foo").bind("destroyed", function(){
   //clean up code
})

Quick Demo

More Involved Demo

© Jupiter IT - JavaScriptMVC Training and Support