admin管理员组文章数量:1287230
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
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
Share
Improve this question
asked Jul 25, 2013 at 9:34
JabherJabher
3285 silver badges12 bronze badges
2
- What kind of content change? – Tim Down Commented Jul 25, 2013 at 9:46
- See stackoverflow./a/40195712 for a good answer; including the distinction to textContent – denis hebert Commented Jan 1, 2023 at 16:00
1 Answer
Reset to default 11Hi I think you need to add
subtree: true
in your options list.
Have a look at https://dvcs.w3/hg/domcore/raw-file/tip/Overview.html#mutation-observers
本文标签: javascriptmutationObserverhow to observe innerHTMLStack Overflow
版权声明:本文标题:javascript - mutationObserver - how to observe innerHTML? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741307268a2371443.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论