Ask coding questions

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

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: https://repl.it/@JamesGordon1/phone-webpage It doesn't work for what I need but the menu button code I need to rip and attach to the other two buttons.

Voters
Atomic-Gamming
Comments
hotnewtop
NalinDias

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

[deleted]

Do you want to use JavaScript to show/hide menus? If so have a look at this repl: https://repl.it/@malvoliothegood/dropdown-menu