Introduction
A
Datalist tag represents a list of options that represent predefined options for other controls. The <datalist> tag can be used in conjunction with an <input> tag that contains a list of selectable data as a drop-down list of input values that contains only legal values. DataList is not visible to the user, but it is associated with the <input> tag through the <input> tag list attribute that takes as its value the id attribute value of the <datalist> tag. The drop-down predefined list displays when the user enters any value in the text field. You can say a <datalist> tag provides an auto-complete feature on form tags.
Syntax
<input id="" name="" type="text" list="DataList_ID" />
<datalist id="DataList_ID">
<option value="A">
<option value="B">
<option value="C">
<option value="D">
<option value="E">
</datalist>
HTML5 Event Attributes
|
onabort |
onblur |
oncanplay |
oncanplaythrough |
onchange |
onclick |
oncontextmenu |
ondblclick |
ondrag |
ondragend |
ondragenter |
ondragleave |
ondragover |
ondragstart |
ondrop |
ondurationchange |
onemptied |
onended |
onerror |
onfocus |
onformchange |
onforminput |
oninput |
oninvalid |
onkeydown |
onkeypress |
onkeyup |
onload |
onloadeddata |
onloadedmetadata |
onloadstart |
onmousedown |
onmousemove |
onmouseout |
onmouseover |
onmouseup |
onmousewheel |
onpause |
onplay |
onplaying |
onprogress |
onratechange |
onreadystatechange |
onscroll |
onseeked |
onseeking |
onselect |
onshow |
onstalled |
onsubmit |
onsuspend |
ontimeupdate |
onvolumechange |
onwaiting |
Code:
Output
FireFox
When you enter an unknown URL you will get an error from FireFox only but Opera will not show an error and it will navigate you to your specified URL (that you used in the action attribute).
Opera