Skip to content

Commit

Permalink
Merge pull request #1 from AlexiaA-J/Close-Modal-Issue-#1
Browse files Browse the repository at this point in the history
Fix Issue #1 Close Modal
  • Loading branch information
AlexiaA-J authored Apr 16, 2024
2 parents 380d151 + 1647e02 commit 6bb7d39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions starterOnly/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function editNav() {
const modalbg = document.querySelector(".bground");
const modalBtn = document.querySelectorAll(".modal-btn");
const formData = document.querySelectorAll(".formData");
const modalClose = document.querySelector(".close")

// launch modal event
modalBtn.forEach((btn) => btn.addEventListener("click", launchModal));
Expand All @@ -20,4 +21,13 @@ function launchModal() {
modalbg.style.display = "block";
}

// close modal event

modalClose.addEventListener("click", closeModal)

// close modal form

function closeModal() {
modalbg.style.display = "none";
}

0 comments on commit 6bb7d39

Please sign in to comment.