I'm trying to remove a message from a page, but I can only execute my code only when this message is displayed. How can I do this? Is it more appropriate to remove by the event listener as well?
The function is this:
function removeWindow(){
document.querySelector(".content_form").remove();
document.querySelector(".pop").style.background = 'transparent';
document.querySelector(".footer").remove();
}
Thanks in advance!