![]() |
VOOZH | about |
Bootstrap 5 is the newest version of Bootstrap, which is the most popular HTML, CSS, and JavaScript framework for creating responsive, mobile-first websites. It was officially released on 16 June 2020 after several months of redefining its features.
Bootstrap 5 Form controls datalists are used to create a group of options (group of <option> elements) that can be accessed by using an input element. It is similar to the <select> element but the difference is that it has more menu styling limitations and differences.
Datalist used Tags:
Syntax:
<label for="datalist" class="form-label"> Datalist Label </label> <input class="form-control" list="gfglist" id="datalist" placeholder="search..."> <datalist id="gfglist"> <option value="..."> ... </datalist>
Example 1: In this example, we will create a datalist with a group of options.
Output:
Example 2: In this example, we will create a datalist with a group of color options.
Output:
Reference: https://getbootstrap.com/docs/5.0/forms/form-control/#datalists