Example 1 — Example
Typical usage.
JavaScript
console.log(typeof MutationObserver);
console.log("new MutationObserver(cb).observe(node, { childList: true })");How It Works
- Constructor. Takes a callback.
- observe. Starts watching a node.
MutationObserver watches DOM changes (child list, attributes, character data) asynchronously.
console.log(typeof MutationObserver);
console.log("new MutationObserver(cb).observe(node, { childList: true })");Typical usage.
console.log(typeof MutationObserver);
console.log("new MutationObserver(cb).observe(node, { childList: true })");Check support.
console.log("MutationObserver — verify browser/Node support");CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful