Dropdown menus? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Dropdown menus?

Just wondering how to make dropdowns. Can anyone help me?

7th May 2018, 2:02 AM
Daniel Cooper
Daniel Cooper - avatar
3 Answers
7th May 2018, 5:43 AM
Tim Thuma
Tim Thuma - avatar
+ 10
This is bootstrap dropdown. To use it u have to add bootstrap meta, css and js in the head before. <div class="container"> <div class="dropdown"> <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Languages <span class="caret"></span></button> <ul class="dropdown-menu"> <li>English</li> <li>Spanish</li> <li class="divider"></li> <li class="dropdown-header">Coding</li> <li>C++</li> <li>Java</li> </ul> </div> </div> The head section : <head> <meta charset="utf-8"> <!-- Responsive --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <!-- jQuery --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!-- JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head>
7th May 2018, 2:54 AM
***
0
What will this form send to the database when the second option is selected? <form> <select name="pet"> <option value="cat">Opt 1</option> <option value="dog">Opt 2</option> </select> </form> HTML Opt 2 cat dog
12th May 2023, 12:04 PM
Amarachukwu Godlove Ahanonu