50projects50days/netflix-mobile-navigation/script.js
2020-11-16 11:21:28 -05:00

11 lines
369 B
JavaScript

const open_btn = document.querySelector('.open-btn')
const close_btn = document.querySelector('.close-btn')
const nav = document.querySelectorAll('.nav')
open_btn.addEventListener('click', () => {
nav.forEach(nav_el => nav_el.classList.add('visible'))
})
close_btn.addEventListener('click', () => {
nav.forEach(nav_el => nav_el.classList.remove('visible'))
})