Reputation: 1257
I am trying to achieve a auto complete function by Css For Select Option so Beginner of web i could't it find any sample example for this.could some provide any idea or solution
For example::
In a select box by mention of class name like
<select id="productline" class="Auto-select on">
<option value="Motorcycles">Motorcycles</option>
<option value="Planes">Planes</option>
<option value="Ships">Ships</option>
<option value="Trains">Trains</option>
</select>
Upvotes: 1
Views: 3050
Reputation: 2853
Try this.
The <datalist>
element specifies a list of pre-defined options for an <input>
element.
The <datalist>
element is used to provide an "autocomplete" feature on <input>
elements. Users will see a drop-down list of pre-defined options as they input data.
Use the <input>
element's list attribute to bind it together with a <datalist>
element.
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
Upvotes: 4