---
title: "HTML5 datalist element"  
description: "In HTML5 datalist element can be used in conjunction with an input element that contains a list of attribute. We create list with option element insid"  
author: "Anonymous User"  
published: 2011-07-23  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/583/html5-datalist-element  
category: "html5"  
tags: ["html5"]  
reading_time: 1 minute  

---

# HTML5 datalist element

In HTML5 <datalist>element can be used in conjunction with an <input> element that contains a list of attribute. We create list with <option>element inside in <datalist>element. The list attribute is linked to the <datalist> element by the <datalist>element id. The datalist element specifies a list of option for an input field. To bind a datalist to an input field, let the list attribute of the input field refer to the id of the datalist. This will work as autocomplete textbox in html.\

##### Code:

```
<body>    Enter your favorite Crickter     <input type="text" id="Cricktername" list="name">     <datalist id="name">      <option value="Sachin Tendulkar" />      <option value="Virender Shewag" />      <option value="M S Dhoni" />      <option value="Yuvraj Singh" />      <option value="Suresh Raina" />      <option value="Yusuf Pathan" />    </datalist></body>
```

![HTML5 datalist element](https://www.mindstick.com/mindstickarticle/c23892b2-baad-4049-8403-e2c35ab5cb4c/images/9c9925dd-8562-4ab6-ad08-11fd478ed7f9.png)

---

Original Source: https://www.mindstick.com/articles/583/html5-datalist-element

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
