I am very new to using javascript and i dont fully understand it yet. I tried making a drop down bar with this html containing of a nav bar with a div that has some anchor tags. The javascript is a function retrieving the anchor tags by class using querySelectorAll. And a let determining whether or not the dropdown menu is open. It will change the style depending on this. If its really bad code please tell me im very new to this.(https://i.stack.imgur.com/VO6sF.jpg)(https://i.stack.imgur.com/6iL1P.jpg)
The issue is that when i hover on the dropdown it goes down which is good. But when i leave it it doesnt go back up.