Invoke a callback when a DOM element is removed from the document