Skip to content
Sign upLog in
← Back to Community

How can I make a input drop-down?

Profile icon
tyagir2392

So I want to make a drop-down menu, where users don't have to choose the the given options and can make their own, but I can't find a way to do this, does anyone have way to make this with javascript and HTML?

Voters
Profile icon
Ben24134
Profile icon
tyagir2392
Comments
hotnewtop
Profile icon
Coder100

use something like an radio, the industry standard:

<label><input type="radio" name="e"> Option a</label> <label><input type="radio" name="e"> Option b</label> <label><input type="radio" name="e"> Option c</label> <label><input type="radio" name="e"> Other (please specify): <input value="SAY"></label>

and its so easy no js required.

Profile icon
Andy_4sberg

Make a link or button that hides/shows a form with text inputs.
This worked for me:

<script> function something() { // Put code here } function visible() { var is_visible = document.getElementById("menu"); if (is_visible.style.visibility==='visible') { is_visible.style.visibility='hidden'; } else { is_visible.style.visibility='visible'; } } </script> <button onclick="visible()">Drop down menu</button> <form id="menu" style="visibility: hidden;"> <input type="text" placeholder="Textbox one" onchange="something()" id="txtboxone"> <br> <input type="text" placeholder="Textbox two" onchange="something()" id="txtboxtwo"> </form>