ePopupBtn"); const myPopup = document.getElementById("myPopup"); openPopupBtn.addEventListener("click", () => { myPopup.style.display = "flex"; myPopup.style.animation = "fadeIn 0.3s ease-in-out"; }); closePopupBtn.addEventListener("click", () => { myPopup.style.animation = "fadeOut 0.3s ease-in-out"; setTimeout(() => { myPopup.style.display = "none"; }, 300); }); window.addEventListener("click", (event) => { if (event.target === myPopup) { myPopup.style.animation = "fadeOut 0.3s ease-in-out"; setTimeout(() => { myPopup.style.display = "none"; }, 300); } });