Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
2

How can I make a input drop-down?

tyagir2392
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?

2 years ago

Voters

Comments

TopNew
1
Coder100
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.

2 years ago
1
Andy_4sberg
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>
2 years ago
Load more