The code at the bottom is not recognized but I don't know why. Can anyone see the problem?
The code of my whole JavaScript-File is:
const navSlide = () => {
const burger = document.querySelector('.burger');
const nav = document.querySelector('.nav-links');
const navLinks = document.querySelectorAll('.nav-links li');
burger.addEventListener('click', () => {
//Toggle nav
nav.classList.toggle('nav-active');
//Animate Links
navLinks.forEach((link, index) => {
if(link.style.animation) {
link.style.animation = '';
}
else {
link.style.animation = `navLinkFade 0.5s ease forwards 0.5s`;
}
});
//Burger animation
burger.classList.toggle('toggle');
});
};
navSlide();
// dont show arrow at mobile - code is not recognized? :/ ...
window.resize(function() {
if (window.innerwidth() <= 1024) {
document.getElementById("myElement").innerHTML = "Hunde";
} else if (window.innerwidth() >= 1024){
document.getElementById("myElement").innerHTML = "Hunde↓";
}
}).resize();
And the according html I want to change is:
<a class="atag hunde" href="#">Hunde↓</a>
My goal is that the arrow disappears when the screen width is lower than 1024px but the code at the bottom is not recognized I think.