+ 2
why is this code not working?
const menuToggle = document.querySelector('.menu-toggle input') const nav = document.querySelector('nav ul') menuToggle.addEventListener('click', function(){ nav.classList.toggle('slide'); }); https://code.sololearn.com/W7St8Oz2IMMy/?ref=app
3 Respuestas
+ 2
your javascript is run before html is loaded. which makes some variables null.
put your code inside this function.
window.onload = function(){
//your code
}
+ 5
Can you tag the language for your question?
Also, it would be easier to say what's wrong if you could attach your whole code from the code playground.
Thanks
https://code.sololearn.com/W3uiji9X28C1/?ref=app
+ 1
thank you.....