<div class="hamburger" onclick="toggleMenu();"> </div>
let menu = document.getElementsByClassName('nav__list')[0];
function toggleMenu() {
if (menu.className == "nav__list") {
menu.classList.add ("open");
} else {
menu.className = "nav__list";
}
window.toggleMenu = function() {// code here}
const toggleMenu = function() {
if (menu.className === "nav__list") {
menu.classList.add("open");
} else {
menu.className = "nav__list";
}
};
document.querySelector(".hamburger").addEventListener("click", toggleMenu);