ajl123
ajl123

Reputation: 1272

Make input tag into a drop down list

I am trying to make an input tag have a selection of events when I click on it.

It would look something like this? :

<input type="text"/>
<select name="Expiration Month">
<option value="January">January</option>
....
</select>

What I want the image to look like is this.Drop down menu

Upvotes: 2

Views: 9215

Answers (2)

Aameer
Aameer

Reputation: 241

Hope this helps!

<form method="post">
  <input list="browsers">
  <datalist id="browsers">
    <option value="Internet Explorer">
    <option value="Firefox">
    <option value="Chrome">
    <option value="Opera">
    <option value="Safari">
  </datalist> 
</form>

Upvotes: 9

owaism
owaism

Reputation: 1188

There are many JS libraries which will help you with the JavaScript and CSS that you need. As an example if you are using JQuery you can use JQuery UI to do what you want.

For more information go to http://jqueryui.com/autocomplete/#combobox

Upvotes: 1

Related Questions