Search
Web Braintrove
Site Navigation
Home
Products
Tags
Levels
Dates
Authors
5 MOST RECENT
Locate the Design Checker Task Pane in InfoPath 2010
Locate Conditional Formatting and Custom Validation in InfoPath 2010
Conditionally Display Different Values In a Single Expression Box
Create a Button With a Blank Label
Create Shared Rules
5 MOST POPULAR
Access a Method in a Master Page with Code-Behind
Pass Query String Parameters to an ASP.NET Xml Control
Prevent Namespace Prefixes from Being Copied to the Output
Create Groups in a Drop-Down List Box
Configure IIS 7 for Custom Error Pages
5 MOST FORGOTTEN
Install Windows 7 Beta onto a Virtual Machine
Group Dates by Year, Month and Day
Configure Lab Color Mode Defaults for Braintrove Articles
Create a Monochromatic Dream Text Effect Using Styles
Combine Multiple Sums Into a Single Function
Books
HTML and XML for Beginners
Learning Web Design : A Beginner's Guide to HTML, Graphics, and Beyond
Weaving a Website: Programming in HTML, Java Script, Perl and Java
HTML: Your visual blueprint for designing effective Web pages
Sams Teach Yourself Web Publishing with HTML & XHTML in 21 Days
Magazines
Inside Web Development
Inside Web Design
Practical Web Design
Soa Web Services Journal
Net Developers Journal
Microsoft MVP
Very PopularMost Viewed
This article has been viewed 10990 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.