The is used to enable the “autocomplete” feature for elements. Users will see a drop-down list of predefined options before entering data.
The HTML is used to autocomplete the feature on the form element. It provides a list of predefined options for users to select data.
The should be used with the list” attribute. The value of the “list” attribute is associated with the datalist ID.
Example:-
HTML datalist Tag
HTML Datalist Tag Example
Output:-
HTML Datalist Tag Example
HTML Optgroup Tag
HTML
HTML is used to group related in drop-down list within element. Means to highlight title.
Using with the makes it easier to access the dropdown list, especially if the list contains a large number of options.
Example:-
HTML optgroup Tag
This is HTML optgroup tag Example
Output:-
HTML Option Tag
HTML
HTML is used to define options in the dropdown list inside or . The dropdown list must contain at least one .
The corresponding of a dropdown list can be grouped using the element which helps in understanding a larger list.
Note:- The can be used without an attribute, but must be used with a value attribute that specifies what is sent to the server.
Example:-
HTML option Tag
This is HTML option tag Example
Output:-