Search
Web Braintrove
Site Navigation
Home
Products
Tags
Levels
Dates
Authors
5 MOST RECENT
Create Shared Rules
Perform a Case-Insensitive String Comparison without Using Translate()
Force a Field Value to a Boolean Using Rules
Quickly Crop to a Shadow
Sum Repeating Time Values
5 MOST POPULAR
Pass Query String Parameters to an ASP.NET Xml Control
Access a Method in a Master Page with Code-Behind
Prevent Namespace Prefixes from Being Copied to the Output
Create Groups in a Drop-Down List Box
Change the Default Action of the Power Button on the Windows Vista Start Menu
5 MOST FORGOTTEN
Recover a Dark Picture with a Heavy Color Cast
Hide Deleted Items in the Source Control Explorer
Prevent Windows Vista from Requesting Your Permission to Continue
Create a Variable with a Unique Sorted Node-Set
Get the Oldest or Newest Date Value of a List Node
Books
Weaving a Website: Programming in HTML, Java Script, Perl and Java
How to Do Everything with HTML
Build Your Own Web Site the Right Way Using HTML & CSS
HTML and XML for Beginners
HTML Pocket Reference
Magazines
SQL Server Magazine
Web Site Management And Internet Advertising Trends
Net Developers Journal
Inside Visual Basic
.net
Microsoft MVP
Very PopularMost Viewed
This article has been viewed 8926 times.

Create Groups in a Drop-Down List Box

Page 1 of 2
Written by Gregory Scot Collins
Saturday, 17 June 2006, 5:57 AM
This article has been tested to work with the following products and versions. No guarantee of compatibility, with or without modification, is offered for products or versions other than those listed.
Grouping items in a drop-down list box is easy with the optgroup element. The optgroup element is a child to the select element and has two attributes: label (required) and disabled (optional). The required label attribute specifies the text that will appear as a header to the contained group of options. Many browsers render the label text in bold italic. The optional disabled attribute is used to render the entire group of options non-selectable to the user. Options within an option group are indented. Listing 1 shows an example of how to use the optgroup element:
In HTML 4.0, an optgroup element can only contain option elements. In other words, option groups cannot be nested. This may change in a future version of HTML.
Bookmark this Article
StumbleUpon  Stumble It!
Digg  Digg It!
del.icio.us  del.icio.us
Resources
W3C HTML 4.01 Specification: OPTGROUP
MSDN HMLT and DHTML Reference: OPTGROUP
List of Figures
Listing 1 - The optgroup element allows you to grouping options.
Screenshot 1 - Grouped options as rendered in Internet Explorer 6 and Firefox 1.5.
Listing 2 - The optgroup element allows you to grouping options.
Screenshot 2 - Stylized grouped options as rendered in Internet Explorer 6 and Firefox 1.5.
Article Tags
Great Deals
TigerDirect Exclusive Deals, Limited Time Offers, Act Now And Save!
Find all current special offers on Adobe products.
Try SugarSync Free!
Join WebHost4Life.com
TigerDirect
Computers4SURE (4SURE.com - An Office Depot Co.)
Copyright © 2006-2010 Braintrove. All rights reserved. Braintrove, braintrove.com, and the Braintrove logo are trademarks of Gregory Scot Collins in the United States and/or other countries. The names of actual companies and products mentioned herein may be the trademarks of their respective owners. Any rights not expressly granted herein are reserved.