Skip to content

Commit

Permalink
Fix issue OpenClassrooms-Student-Center#1 close modal and issue OpenC…
Browse files Browse the repository at this point in the history
  • Loading branch information
metalfeanor committed Apr 3, 2021
1 parent 74e7ea1 commit cabd35a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions starterOnly/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ <h1 class="hero-headline">
id="first"
name="first"
minlength="2"
required
/><br>
</div>
<div
Expand All @@ -81,6 +82,7 @@ <h1 class="hero-headline">
type="text"
id="last"
name="last"
required
/><br>
</div>
<div
Expand All @@ -91,6 +93,7 @@ <h1 class="hero-headline">
type="email"
id="email"
name="email"
required
/><br>
</div>
<div
Expand All @@ -101,6 +104,7 @@ <h1 class="hero-headline">
type="date"
id="birthdate"
name="birthdate"
required
/><br>
</div>
<div
Expand Down
9 changes: 7 additions & 2 deletions starterOnly/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@ function editNav() {
// DOM Elements
const modalbg = document.querySelector(".bground");
const modalBtn = document.querySelectorAll(".modal-btn");
const modalCloseBtn = document.querySelectorAll(".close");
const formData = document.querySelectorAll(".formData");

// launch modal event
modalBtn.forEach((btn) => btn.addEventListener("click", launchModal));
// close modal event
modalCloseBtn.forEach((e) => e.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 cabd35a

Please sign in to comment.