https://codepen.io/codeobsession/pen/XWrwEEz?editors=0011
This is the link to the project after toggling the memu button the ul is working ,but is still in visible state even after the menu button is toggled-off
on your onclick-event your are setting:
list.style.opacity = 1;
and so opacity will always be:1
Also on your next click.
You could try to toggle opacity:
- is opacity = 0 -> set it to 1 and vice versa