njpma/app/static/js/menu.js
2021-10-11 13:26:51 +01:00

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()
}
})