Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ugobresso committed Mar 18, 2024
1 parent 55d613c commit cbbef15
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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 modalCloseBtn = document.querySelectorAll(".close");

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

// close modal event
modalCloseBtn.forEach((btn) => btn.addEventListener("click", closeModal));

// close modal form
function closeModal() {
modalbg.style.display = "none";
}

0 comments on commit cbbef15

Please sign in to comment.