Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML

Dennis Castillo
Dennis Castillo
16,018 Points

Need Help Remember A Simple Code...

Need a help to remember a simple code from one of this tutorial "HTML", I found it very use full but seems my memory is not enough to remember :)

I created a "select" for drop down menu and there is 5 text in it. 1st. one is non-clickable (showing in gray color "Title") and the other 4 text is clickable (hyper link "whatever..."). What is that a simple code for the 1st. text on select drop down menu? this 1st text is for only like a title for 4 text (A title for events...)

Thanks and God Bless...

2 Answers

Spencer Merritt
Spencer Merritt
10,615 Points

The first item in the dropdown box that is greyed out is an "option group" or <optgroup> to describe the following items. it would be coded as:

<select>
     <optgroup label="Colors">  <!-- This is the greyed out option group that describes the options -->
          <option>Red</option>  <!-- These are the clickable options -->
          <option>Blue</option>  <!-- These are the clickable options -->
          <option>Green</option>  <!-- These are the clickable options -->
     </optgroup>
</select>
Dennis Castillo
Dennis Castillo
16,018 Points

AHA! option group I remember now it's optgroup tag nice... thanks for your help :D