Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var backdrop = document.querySelector('.backdrop');
- var modal = document.querySelector('.modal');
- var noButton = document.querySelector('.modal__action--negative');
- var planButtons = document.querySelectorAll('.plan button');
- planButtons.forEach(function(item) {
- item.addEventListener('click', function() {
- backdrop.style.display = 'block';
- modal.style.display = 'block';
- });
- })
- noButton.addEventListener('click', function() {
- backdrop.style.display = 'none';
- modal.style.display = 'none';
- });
- backdrop.addEventListener('click', function() {
- backdrop.style.display = 'none';
- modal.style.display = 'none';
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement