+ 1
What's the error in addEventListener
const btn = document.getElementById("btn"); const menu = document.getElementById("menu"); btn.addEventListener("click", ()=>{ if (btn.checked == true){ menu.classList.add("active"); }else {menu.classList.remove("active");} })
1 Odpowiedź
+ 1
Use the window.onload
https://code.sololearn.com/Wv9l6lAwIYL9/?ref=app