My question is somewhat weird, but can i add events for any DOM elements(div), like 'onHtmlChange', to be notified when that div has changed their content?
+2
A:
Check out DOMNodeInserted and DOMNodeRemoved.
Ben Nadel recently blogged the following: Detecting When DOM Elements Have Been Removed With jQuery
Jonathan Sampson
2009-08-24 20:48:12
Seems like the OP wants to know when HTML content inside of the divs has changed though.
seth
2009-08-24 20:58:18
@seth —Browsers which use the W3C model should fire both `DOMNodeInserted` and `DOMNodeRemoved` when changing a node's contents, even it it's just text nodes (just tested FF3). The IE trick mentioned in the linked article could easily be extended to `.html()` and `.text()` to mimic this.
Ben Blank
2009-08-24 21:12:27