Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisbertier committed May 6, 2024
1 parent 380d151 commit e5ff6e2
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 modalClose = document.querySelector('.close');

// launch modal event
modalBtn.forEach((btn) => btn.addEventListener("click", launchModal));
Expand All @@ -19,5 +20,12 @@ modalBtn.forEach((btn) => btn.addEventListener("click", launchModal));
function launchModal() {
modalbg.style.display = "block";
}
// close modal form

function modalCloseForm(){
modalbg.style.display = "none";
}
modalClose.addEventListener('click', ()=> {
modalCloseForm()
})

0 comments on commit e5ff6e2

Please sign in to comment.