DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Group Select Box

12.22.2005
| 7470 views |
  • submit to reddit
        // description of your code here

<p>
<label for="">Select</label>
<select name="">
<option selected label="none" value="none">Selected Option</option>

<optgroup label="Group 1">
<option label="label" value="value">Option 1</option>
<option label="label" value="value">Option 2</option>
<option label="label" value="value">Option 3</option>
</optgroup>

<optgroup label="Group 2">
<option label="label" value="value">Option 1</option>
<option label="label" value="value">Option 2</option>
<option label="label" value="value">Option 3</option>
</optgroup>

<optgroup label="Group 3">
<option label="label" value="value">Option 1</option>
<option label="label" value="value">Option 2</option>
<option label="label" value="value">Option 3</option>
</optgroup>
</select>
</p>