Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
melacod committed Jun 4, 2021
1 parent e7be483 commit b9817c7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion starterOnly/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

0 comments on commit b9817c7

Please sign in to comment.