MutationObserver options
The settings passed to observe() that choose what a MutationObserver watches: child nodes, attributes, text, and whether to include the whole subtree.
In more detail
childList: true reports added and removed children, attributes: true reports attribute changes, attributeFilter limits that to named attributes, and subtree: true extends everything to all descendants. Watching less means fewer records and less work.
Related terms
- MutationObserver — A browser object that watches part of the DOM and reports changes, such as added nodes or changed attributes, in batches.
- subtree — A node together with everything below it, which is itself a tree.
Taught in
- MutationObserver: Reactive DOM Watching Without Polling — Frontend Architecture & Web Platform