tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 HTML > Basic > Select Tag

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.

File Name  :  
source/HTML/basic_tags/select_tag.html 
01<html>
02<body>   
03    <h2>Select Tag</h2>
04 
05    Basic Select Tag :
06    <select>
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>
13    </select>
14     
15    <br><br><br>
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>
24    </select>
25 
26    <br><br><br>
27    Select Tag with option group :
28    <select>
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>
33        </optgroup>
34 
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>
39        </optgroup>
40 
41    </select>
42 
43</body>
44</html>

It gives the following output,
File Name  :  
source/HTML/basic_tags/select_tag.html 

Select Tag

Basic Select Tag :


Select Tag with Size 4 and multi-select :


Select Tag with option group :



 
  


  
bl  br