removed duplicate element selector & added semicolon

This commit is contained in:
Andrew Dutson 2023-03-26 10:49:18 -06:00
parent db23fc7309
commit 39ed908683
1 changed files with 2 additions and 3 deletions

View File

@ -1,10 +1,9 @@
const openButton = document.getElementById('trigger-modal'); const openButton = document.getElementById('trigger-modal');
const closeButton = document.getElementById('close-modal'); const closeButton = document.getElementById('close-modal');
const backdrop = document.getElementById('backdrop')
function toggleModal() { function toggleModal() {
const modalDiv = document.querySelector('.popup-modal'); const modalDiv = document.querySelector('.popup-modal');
const backdrop = document.querySelector('.backdrop') const backdrop = document.querySelector('.backdrop');
modalDiv.classList.toggle('show'); modalDiv.classList.toggle('show');
backdrop.classList.toggle('show'); backdrop.classList.toggle('show');
} }