i am using mutationObserver to detect changes using bellow code
var target = document.querySelector('body');
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
console.log(mutation.type);
});
});
var config = { attributes: true, childList: true, characterData: true };
observer.observe(target, config);
in this i am able to detect changes if changes happen inside the targeted element right now i am targeting body
what i exactly want is the mutationObserver event only fires when the element i had specified is added to the DOM