Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Forms Choosing Options Select Menus

Kevin Albright
Kevin Albright
5,385 Points

Stuck on HTML Forms challenge question

I think there is a bug on the html Challenge Form 3 of 4 that is not allowing me to pass. I'm pretty sure my code is correct and I am getting the desired output, but every time I add the optgroup label, it's saying my test 2 is no longer passing.

Can you take a look and see if there is a problem (or make me feel dumb by showing me where I'm missing a quotation mark or something)?

Thanks!

My Code:

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Forms</title> </head> <body>

<form action="index.html" method="post">
  <h1>Shirt Order Form</h1>
   <select id="color" name="shirt_color">
        <optgroup label="Shirt Color:">
          <option value="red">Red</option>
          <option value="yellow">Yellow</option>
          <option value="purple">Purple</option>
          <option value="blue">Blue</option>
          <option value="green">Green</option>
          <option value="orange">Orange</option>
        </optgroup>
      </select>
</form>

</body> </html>

1 Answer

Hey Kevin,

You almost got it right but they weren't looking for a opt group but for a label tag

Heres what it should look like

<meta charset="utf-8">
<title>HTML Forms</title>



<form action="index.html" method="post">
  <h1>Shirt Order Form</h1>
  <label for="color">Shirt Color</label>
   <select id="color" name="shirt_color">

          <option value="red">Red</option>
          <option value="yellow">Yellow</option>
          <option value="purple">Purple</option>
          <option value="blue">Blue</option>
          <option value="green">Green</option>
          <option value="orange">Orange</option>

      </select>
</form>

Hope this helps and if it does please make this best answer.