Well, I want to do something like this:
const config_observer = { attributes: true};
const observer = new MutationObserver(function(mutations) {
console.log("changed")
});
observer.observe(document.body.querySelector("#random-id"), config_observer);
observer.observe(document.body.querySelector("#something"), config_observer);
document.body.querySelector("button").addEventListener("click", () => {
observer.disconnect(document.body.querySelector("#something"));
});
I know that the disconnect function doesn’t have parameters. So, is there some way to do this or something like that?
Thanks Advanced.