const targetNode = document.querySelector("#someElement");
const observerOptions = {
childList: true,
attributes: true,
};
const observer = new MutationObserver(callback);
observer.observe(targetNode, observerOptions);
/* some time later… */
observer.disconnect();MutationObserver: disconnect() method / notebook
MutationObserver: disconnect() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.