Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Put input inside select

Tags:

html

css

Is there a way to place an INPUT field inside select?

<select name="menu_files" class="form-control" >
    <option value="new_menu"> <input type="text"></option>
</select>
like image 473
Andrew Bro Avatar asked Jul 24 '26 20:07

Andrew Bro


1 Answers

<datalist> Element

The datalist element is intended to provide a better mechanism for this concept.

<input type="text" name="example" list="exampleList">
<datalist id="exampleList">
  <option value="A">  
  <option value="B">
</datalist>

For more information, see

  • MDN HTML Reference - <datalist> Element
like image 77
georgeawg Avatar answered Jul 27 '26 12:07

georgeawg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!