Page 144 - TP_iPlus_V2.1_Class7
P. 144

The above code will create a drop-down list in which these countries names are available.

                  Let us create a web page to display the datalist.
                  <!DOCTYPE HTML>

                  <HTML>

                  <HEAD>

                  <TITLE>Countries</TITLE>

                  </HEAD>

                  <BODY>

                  <FORM>

                  Choose Your Country:

                  <INPUT LIST="Countries" NAME="Country">

                  <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>
                  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:




                   142
                          iPlus (Ver. 2.1)-VII
   139   140   141   142   143   144   145   146   147   148   149