Select Tag
The following example shows using select tag. Attribute multiple="multiple" allows
us to select multiple options from the select box and size specifies the number
of select options to display.
07
<
option
value
=
"1"
>Select Option#1</
option
>
08
<
option
value
=
"2"
>Select Option#2</
option
>
09
<
option
value
=
"3"
>Select Option#3</
option
>
10
<
option
value
=
"4"
>Select Option#4</
option
>
11
<
option
value
=
"5"
>Select Option#5</
option
>
12
<
option
value
=
"6"
>Select Option#6</
option
>
16
Select Tag with Size 4 and multi-select :
17
<
select
size
=
"4"
multiple
=
"multiple"
>
18
<
option
value
=
"1"
>Select Option#1</
option
>
19
<
option
value
=
"2"
>Select Option#2</
option
>
20
<
option
value
=
"3"
>Select Option#3</
option
>
21
<
option
value
=
"4"
>Select Option#4</
option
>
22
<
option
value
=
"5"
>Select Option#5</
option
>
23
<
option
value
=
"6"
>Select Option#6</
option
>
27
Select Tag with option group :
29
<
optgroup
label
=
"First Half"
>
30
<
option
value
=
"1"
>Select Option#1</
option
>
31
<
option
value
=
"2"
>Select Option#2</
option
>
32
<
option
value
=
"3"
>Select Option#3</
option
>
35
<
optgroup
label
=
"Second Half"
>
36
<
option
value
=
"4"
>Select Option#4</
option
>
37
<
option
value
=
"5"
>Select Option#5</
option
>
38
<
option
value
=
"6"
>Select Option#6</
option
>
It gives the following output,
Select Tag
Basic Select Tag :
Select Option#1
Select Option#2
Select Option#3
Select Option#4
Select Option#5
Select Option#6
Select Tag with Size 4 and multi-select :
Select Option#1
Select Option#2
Select Option#3
Select Option#4
Select Option#5
Select Option#6
Select Tag with option group :
Select Option#1
Select Option#2
Select Option#3
Select Option#4
Select Option#5
Select Option#6