The datalist tag provides a list for options that are predefined for an input element in the html.
The datalist tag can be used to provide an "autocomplete" feature on input elements. After using this the predefined options list is made as we input the data. It is not supported in Internet Explorer 9 and earlier versions, or in Safari.
Example:
<!DOCTYPE html>
<html>
<body>
<form action="formheader.php" method="get">
<input list="language" name="language">
<datalist id="language">
<option value="PHP">
<option value=".NET">
<option value="JAVA">
<option value="JAVASCRIPT">
<option value="HTML5">
</datalist>
<input type="submit">
</form>
</body>
</html>
In the above example when we fill the data on the input field it will automatically give the list that is matched to the data.
0 Comment(s)