Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mutationObserver - how to observe innerHTML?

Is it possible to observe innerHTML of node via mutationObserver? I'm trying to use characterData: true, but it does not shoot any callback on content change. full options list:

childList: true,
attributes: true,
characterData: true
like image 312
Jabher Avatar asked Dec 20 '22 02:12

Jabher


1 Answers

Hi I think you need to add

subtree: true

in your options list.

Have a look at https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#mutation-observers

like image 161
Damiaan Dufaux Avatar answered Jan 05 '23 22:01

Damiaan Dufaux