Is it possible to detect if the content of a paragraph has been changed in JQuery ?
I tried the below code.
Text
You don't necessarily need JQuery, in modern browsers the web API includes mutation observers. For older browsers there are mutation events.
mutation observer example:
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
alert(mutation.type);
});
});
Fiddle with mutation observers: http://jsfiddle.net/nnbqye55/5/
For JQuery/older IE support, see: https://github.com/kapetan/jquery-observe