Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Datalist Element
Datalist Element

Datalist is a HTML5 element used to specifies a list of pre defined options for an <input> element. It provides autocomplete feature on input elements, when users input data they will see a drop-down list or menu of pre defined options.

Syntax

<datalist>
<option>Option 1</option>
<option>Option 2</option>
<option>Option 3</option>
</datalist>


You can define one or more than one datalist element in a document.


Example


Practice Task

Open notepad or any other text editor, follow the following points.


  • Use <form> element to create form
  • Inside form use <datalist> element to create list of your choise
  • Inside form use <input> element for input data
  • Inside form create submit button using <input type="submit">

save file with name task.html or task.htm and then open it using any browser and see results.


Solution