HTML5 Forms, Part 2 part 2

HTML Fundamentals
HTML5
HTML5 Forms, Part 2
5
2/3
               

Search Options



The <datalist> tag can be used to define a list of pre-defined options for the search field:
<input id="car" type="text" list="colors" />
<datalist id="colors">
<option value="Red">
<option value="Green">
<option value="Yellow">
</datalist>
Try It Yourself

Result:
<option> defines the options in a drop-down list for the user to select. 
The ID of the datalist element must match with the list attribute of the input box.

Comments

Popular posts from this blog

SVG Animations & Paths part 2

header, nav & footer part 1