Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 40 - 2625 PortGPt V2.1
P. 40

    The <SELECT> Tag
                      Sometime, we need to display multiple options in the form of a drop-down menu or list from which
                      we can select only one option at a time. The <SELECT> tag with the <OPTION> tag allows us to
                      create a drop-down list. The <OPTION> tag specify an option in the drop-down list. The syntax of the

                      <SELECT> tag is as follows:

                      <SELECT>
                      <OPTION> Option 1

                      <OPTION> Option 2
                      <OPTION> Option N

                      </SELECT>

                      Let us create a student registration form by using form elements of HTML. The code to create the
                      registration form is as follows:

                      <HTML>
                      <HEAD>

                      <TITLE> Form </TITLE>
                      </HEAD>

                      <BODY BGCOLOR="lightyellow" TEXT="blue">
                      <CENTER>

                      <H1> Registration Form </H1>

                      </CENTER>
                      <HR>

                      <FORM>
                      Name : <INPUT TYPE="TEXT"> <BR><BR>

                      Father's Name : <INPUT TYPE="TEXT"> <BR><BR>
                      Age in Years : <INPUT TYPE="TEXT"> <BR><BR>

                      Gender  :  <INPUT  TYPE="RADIO"  NAME="gender">  Male  <INPUT  TYPE="RADIO"
                      NAME="gender"> Female  <BR> <BR>

                      Address : <TEXTAREA ROWS ="4" COLS = "80"> </TEXTAREA> <BR> <BR>
                      Hobbies: <BR>

                      <INPUT TYPE="CHECKBOX"> Playing Cricket <BR>
                      <INPUT TYPE="CHECKBOX"> Listening to Music <BR>

                      <INPUT TYPE="CHECKBOX"> Reading Books <BR>
                      <BR> <BR>

                      38    Premium Edition-VIII

| 35 36 37 38 39 40 41 42 43 44 45 |