This is the javascript I use for my burger navigation. My code works perfectly on Chrome, but it doesn't works on my iPhone. I think it has to do with the "click" but i'm not sure.
I tried using "touchend" instead of click but that doesn't work either.
This is my code:
onload = function() {
var hetMenu = document.querySelector("body > header nav");
hetMenu.addEventListener("click", menuToggle);
}
function menuToggle() {
var deBody = document.querySelector("body");
deBody.classList.toggle("navigatie");
console.log(deBody.classList);
}