8 lines
293 B
JavaScript
8 lines
293 B
JavaScript
document.querySelectorAll(".topnav a.icon").forEach(a => {
|
|
a.onclick = (event) => {
|
|
var nav = document.querySelector('.topnav nav')
|
|
nav.style.display = nav.style.display === 'block' ? 'none' : 'block'
|
|
event.preventDefault()
|
|
event.stopPropagation()
|
|
}
|
|
})
|