开发者

Detect elements removing

I need to capture event, when some element was开发者_如何学Go removed from the DOM.

Removing can be done in following ways:

  1. with jQuery.remove()
  2. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜