RRM
RRM

Reputation: 2669

plain html combo box code

I've searched online and didn't find even one example of a combo box which could be rendered using plain HTML and Javacript.

Is it possible to have a combobox using standard HTML and Javascript? By combo-box, I mean where input is also possible and a drop-down options are also possible - in a single element. I'm not looking for one select box and in addition another input box.

An example of what I'm looking for is:

https://demos.telerik.com/kendo-ui/combobox/cascadingcombobox

However, I don't want to use any Javascript library like jQuery.

Upvotes: 2

Views: 4641

Answers (1)

brk
brk

Reputation: 50291

Seems you are looking for datalist.

datalist is an html5 component. This same feature can be created using input box and ul, li elements

<label for="countries">Choose a Country:</label>
<input list="countryList" id="countries" name="countries" />
<datalist id="countryList">
  <option value="India">
  <option value="France">
  <option value="Isreal">
  <option value="USA">
  </datalist>

Upvotes: 1

Related Questions