I need to capture event, when some element was开发者_如何学Go removed from the DOM.
Removing can be done in following ways:
- with
jQuery.remove()
- after hitting backspace in paragraph (that has "contentEditable" attr)
The only way, I know, to determine second case - is to count elements and compare after each hitting of backspace key.
Maybe there is a more elegant way exist ?
There are the DOM Mutation Events, specifically DOMNodeRemoved
and DOMNodeRemovedFromDocument
, but IE has historically not supported them. They are supposedly supported in IE9.
精彩评论