2

I would like to capture the event when the div content change and display some alert before the div content change. Below is what I am doing....

jQuery('#myDiv').bind('DOMSubtreeModified', function () {
        alert('SUDIPTA ... Hi there, hello');
});

But seems like alert message is not coming. Can you please help me? Thanks.

Sudipta Deb
  • 1,040
  • 3
  • 23
  • 43

1 Answers1

0
var div_eTypes = [],
div_changes = [];
$(function() {
$('#myDiv').each(function() {
    this['data-initialContents'] = this.innerHTML;
}).bind('DOMNodeInserted DOMNodeRemoved', function(event) {
    div_eTypes.concat(e.type.match(/insert|remove/));
    div_changes.concat(this.innerHTML);
});

});

Gaurang s
  • 831
  • 6
  • 18