From b9817c7e959a422dc46c98435c31e0515a698564 Mon Sep 17 00:00:00 2001 From: melacod Date: Fri, 4 Jun 2021 09:51:26 +0200 Subject: [PATCH] fix #1 --- starterOnly/modal.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/starterOnly/modal.js b/starterOnly/modal.js index 694a848564..29983e5a57 100644 --- a/starterOnly/modal.js +++ b/starterOnly/modal.js @@ -11,13 +11,20 @@ function editNav() { const modalbg = document.querySelector(".bground"); const modalBtn = document.querySelectorAll(".modal-btn"); const formData = document.querySelectorAll(".formData"); +const closeBtn = document.querySelector(".close"); // launch modal event modalBtn.forEach((btn) => btn.addEventListener("click", launchModal)); +//close modal event +closeBtn.addEventListener("click", closeModal); + // launch modal form function launchModal() { modalbg.style.display = "block"; } - +//close modal form +function closeModal() { + modalbg.style.display = "none"; +}