Added little javascript as working on website but dont know why its not working

https://codepen.io/QasimGhgh/pen/poyYrKJ
menu toggle on smaller screen isnt working can anybody guide me plz.

It should be menutoggle() not menutoggle for the onclick attribute.

MDN: HTML onevent attributes

thanks it was my first time adding javascript in my web page so didnt knew that

No problem. For the most, I would suggest using addEventListener instead.

The MDN page might be a bit overwhelming so here are some videos as well



1 Like