A dropdown menu by button? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

A dropdown menu by button?

can anyone tell me how to make a dropdown menu which is toggle by a button?

26th Feb 2017, 6:12 PM
Hassan Ejaz
Hassan Ejaz - avatar
3 Answers
+ 4
On click on the button, toggle a class name on the element you want to hide/display... you can easily add animation effects by using css transition features. Solution purely css is sometimes possible, but depends on context and often keep some limitations... anyway, as you tag 'javascript' in the question, I guess you don't care :P
26th Feb 2017, 8:28 PM
visph
visph - avatar
27th Feb 2017, 7:33 AM
visph
visph - avatar
+ 1
ok but can you tell my code of procedure?
27th Feb 2017, 5:31 AM
Hassan Ejaz
Hassan Ejaz - avatar