Advertisement
dev_imran

Popup-js

Apr 5th, 2020
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // grave id
  2. const quoteBtn = document.getElementById('quoteBtn');
  3. const closeQuote = document.getElementById('popupClose');
  4. const quoteWindow = document.getElementById('getQuot');
  5.  
  6.  
  7. // event listener
  8. quoteBtn.addEventListener('click', openPopup);
  9. closeQuote.addEventListener('click', closePopup);
  10.  
  11. function openPopup() {
  12.   quoteWindow.className = 'activePopup';
  13. }
  14. function closePopup() {
  15.   quoteWindow.classList.remove('activePopup')
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement