Ask coding questions

← Back to all posts
How can i change dropdown menu from a hover over to a on/off button

How can I change the dropdown menu to activate when clicked instead of when hovered over? I am trying to make this mobile-friendly but I can't get the dropdown menu to stay open when clicked.

that is what I have done so far but it doesn't work, can you make one that works, please?

Here are the buttons that need to be changed:

I found this code: It doesn't work for what I need but the menu button code I need to rip and attach to the other two buttons.


I tried doing that too but it still didn't work


Do you want to use JavaScript to show/hide menus? If so have a look at this repl: