The OPTGROUP Tag

By Deane Barker on July 2, 2004

HTML Tip: Sorting With The OPTGROUP Element: I found a tag today that I had never heard of before. OPTGROUP allows you to have an option in a dropdown that isn’t selectable, is seperately formattable via CSS, and that other options are indented under.

Until recently, the OPTGROUP element belonged to that lonely category of valid HTML tags that most major browsers didn’t recognize. Fortunately, Netscape 6.x and Explorer 6.0 for Windows have joined Explorer 5.0/Mac in supporting this handy way to categorize SELECT lists. […]

…OPTGROUP is low-impact. Older browsers just ignore the element and display a regular SELECT list.

Visit the page to see a screencap. Apparently IE 5.0 for Mac is the only browser that supports it to the extent called for in the spec, essentially creating collapsible flyout menus. Very, very handy.

Gadgetopia

Comments

  1. The HTML spec doesn’t actually call for collapsible flyout menus. The way the latest versions of Mozilla, Netscape, Opera, and IE for Windows render it is just fine.

    The HTML spec suggests that graphical browsers may render them as “a hierarchical menu or some other mechanism that reflects the structure of choices.”

Comments are closed. If you have something you really want to say, email editors@gadgetopia.com and we‘ll get it added for you.