Burger menu JavaScript not working

Hi! I am trying to use a JavaScript function to toggle on and off my burger menu list, but for some reason is not working. I attached a video so you can see what's going on. You can also take a look at my code here: https://codepen.io/Abdiel-Peguero/pen/MWLPjej
Thanks in advance!!
5 Replies
Jochem
Jochem•12mo ago
.navbar-links:active {
display: flex;
}
.navbar-links:active {
display: flex;
}
should be
.navbar-links.active {
display: flex;
}
.navbar-links.active {
display: flex;
}
there is an :active pseudo-class, but that represents an activated element, not an element with the class active on it
Abdiel Peguero
Abdiel Peguero•12mo ago
Great! Let me try it. Thanks so much for your help!
Abdiel Peguero
Abdiel Peguero•12mo ago
I can't thank you enough for your help. Here's the proof that it worked.
Abdiel Peguero
Abdiel Peguero•12mo ago
I had been struggling with this for a few days! I finally gave up and decided to look for help. Thank you for taking your valuable time to review my code and give me a quick solution!
Jochem
Jochem•12mo ago
Glad to help 🙂
Want results from more Discord servers?
Add your server