Is there a DOM event that fires when elements are created?
I'm using the script below to scan for and remove a HTML div that is created dynamically.
I'd prefer to hook into the DOM event model instead of polling.
function remove_new_element(){
document.getElementsByClassName("new_element")[0].remove();
clearInterval(lookfor_new_element);
}
function lookfor_new_element(){
(document.getElementsByClassName("new_element").length==1)?
remove_new_element():null;
}
setInterval(lookfor_new_element,1000)