jQuery Event : Detect changes to the html/text of a div

If you don’t want use timer and check innerHTML you can try this event

$('mydiv').on('DOMSubtreeModified', function(){
  console.log('changed');
});

More details and browser support datas are Here.

Leave a Comment