I want to detect changes in a given DOM subtree. What is the best way to do that? I'm fine with using jQuery and chrome browser only solution.
Here are some examples of changes that I want to detect
- Removal or Addition of DOM elements in a given DOM subtree/DOM element.
- CSS changes for e.g., some button in that DOM structure is enabled from being disabled.
- Content changes, Text in some paragraph of a selected div changes.
I want to be able to write this function $(parent).somethingchanges(dothis); which handles all the above cases.