Search
Web Braintrove
Site Navigation
Home
Products
Tags
Levels
Dates
Authors
5 MOST RECENT
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
Preview and Open Forms after Upgrading to Internet Explorer 8
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
Install Windows 7 Beta onto a Virtual Machine
Convert Between Time and Decimal
Configure Lab Color Mode Defaults for Braintrove Articles
Stop Outlook Sending Mail to Unintended Recipients
Add a Custom Icon to Your Web Site
Books
HTML Utopia : Designing Without Tables Using CSS
Oracle HTML DB Handbook
HTML and XHTML Step by Step
Sams Teach Yourself HTML & XHTML in 24 Hours
Creating Cool HTML 4 Web Pages
Magazines
SQL Server Magazine
Practical Web Design
Web Site Management And Internet Advertising Trends
Soa Web Services Journal
Asp.netpro
Microsoft MVP
Very PopularMost Viewed
This article has been viewed 8805 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.