Page 93 - TP_Play_V2.1_class8
P. 93
<DATALIST ID="Countries">
<OPTION VALUE="India">
<OPTION VALUE="China">
<OPTION VALUE="Indonesia">
<OPTION VALUE="Pakistan">
<OPTION VALUE="Bangladesh">
<OPTION VALUE="Japan">
</DATALIST>
</FORM>
</BODY>
</HTML>
Output
THE <SELECT> Tag
The <SELECT> tag is used to add a drop-down list in the HTML form. This tag produces a list of
options for the user with the help of <OPTION> tag. We can create a combo box using <SELECT>
and <OPTION> tags.
Adding Combo Box
Sometimes, it is necessary to display multiple options in the form of a drop-down menu or list
from which the user can select only one option at a time. This type of control is known as combo
box. The <SELECT> tag with the <OPTION> tag allows us to create a drop-down list.
The <OPTION> tag specifies an option in the drop-down list. To create a combo box in a form,
use the following syntax:
<SELECT>
<OPTION> Option 1
<OPTION> Option 2
<OPTION> Option N
</SELECT>
For example:
<SELECT NAME="City">
<OPTION>Aligarh
<OPTION>Ghaziabad
<OPTION>Meerut Output
</SELECT>
The above code will create a dropdown list in which three options are available.
Let us create a web page to display the combo box.
Images, Links and Frame in HTML5 91

