Need help with some JS. Cant see why not working

Hey guys, new to the forum. I was hoping somebody would be able to help me out. I’m working on a fixed left nav. It’s beating me up pretty bad. So what I need is to be able to toggle a menu section open while forcing others to quit. I got this set up and working in my file.

I realized I then need to close an open menu item on second click. I got this working in codepen and it uses almost the same code, but it WILL NOT work in Webflow

Any help would be much appreciated! Need to figure this out for work or I’m screwed!

Codepen:

My webflow fole file without this code above but with the code thats commented out in codepen

https://preview.webflow.com/preview/johnny-bobbys-initial-project?utm_medium=preview_link&utm_source=designer&utm_content=johnny-bobbys-initial-project&preview=546b8e15305c29108e7e03fef6641644&mode=preview


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

Hi @JohnnyD I do not see your code in Webflow project

Hey Stan, just as I posted I looked at the project and noticed I screwed it up and promptly fixed.

Here it is again in case the link changes:
https://preview.webflow.com/preview/johnny-bobbys-initial-project?utm_medium=preview_link&utm_source=dashboard&utm_content=johnny-bobbys-initial-project&preview=546b8e15305c29108e7e03fef6641644&mode=preview

Stan where’s you go :)?

hi @JohnnyD I need also to sleep. :sunglasses:
anyway, I had a similar situation with a double-click on burger and I wrote a small article so you can look if there will be an answer for you.