---
title: "Data List tag in HTML"  
description: "Data List tag in HTML"  
author: "Anonymous User"  
published: 2021-07-20  
updated: 2021-07-20  
canonical: https://www.mindstick.com/forum/156533/data-list-tag-in-html  
category: "html5"  
tags: ["html5"]  
reading_time: 2 minutes  

---

# Data List tag in HTML

What is [Datalist](https://www.mindstick.com/forum/1797/change-text-on-button-in-datalist-not-working) tag in [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript)? And why is it used?

## Replies

### Reply by Anonymous User

HTML <datalist> tag is used in <input> field to provide autocomplete feature for words related to them. These are basically used to accomplish things put into the server. Like, if you are writing your state in any form then an autocomplete option will pop up with initial words which are retrieved with the help of datalist tag.

The datalist tag is introduced in HTML5.

The <datalist> tag must be used with an <input> element that has a 'list' attribute. The value of the 'list' attribute is bound to the datalist id.

Let's discuss it with an example :

```
<!DOCTYPE html>
<html lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
    <meta charset='utf-8' />
    <title>DataList</title>
</head>
<body>
    <label>
        Enter your favorite cricket player: Press any character<br />
        <input type='text' id='favCktPlayer' list='CktPlayers'>
        <datalist id='CktPlayers'>
            <option value='Sachin Tendulkar'>
            <option value='Brian Lara'>
            <option value='Jacques Kallis'>
            <option value='Ricky Ponting'>
            <option value='Rahul Dravid'>
            <option value='Shane Warne'>
            <option value='Rohit Sharma'>
            <option value='Donald Bradman'>
            <option value='Saurav Ganguly '>
            <option value='AB diVilliers'>
            <option value='Mahendra Singh Dhoni'>
            <option value='Adam Gilchrist'>
        </datalist>
    </label>
</body>
</html>
```

Hope this information will be helpful for you.

Happy Coding!


---

Original Source: https://www.mindstick.com/forum/156533/data-list-tag-in-html

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
