From 39ed908683b36a3aafda52b9b72b9593a52aa0f1 Mon Sep 17 00:00:00 2001 From: Andrew Dutson Date: Sun, 26 Mar 2023 10:49:18 -0600 Subject: [PATCH] removed duplicate element selector & added semicolon --- animation/02-pop-up/script.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/animation/02-pop-up/script.js b/animation/02-pop-up/script.js index 4f7c25c..ae59fb5 100644 --- a/animation/02-pop-up/script.js +++ b/animation/02-pop-up/script.js @@ -1,13 +1,12 @@ const openButton = document.getElementById('trigger-modal'); const closeButton = document.getElementById('close-modal'); -const backdrop = document.getElementById('backdrop') function toggleModal() { const modalDiv = document.querySelector('.popup-modal'); - const backdrop = document.querySelector('.backdrop') + const backdrop = document.querySelector('.backdrop'); modalDiv.classList.toggle('show'); backdrop.classList.toggle('show'); } openButton.addEventListener('click', toggleModal); -closeButton.addEventListener('click', toggleModal); +closeButton.addEventListener('click', toggleModal); \ No newline at end of file