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

Charles Harpke
Charles Harpke
33,986 Points

Choosing Options/Create Checkbox Challenge/Challenge task 3 of 3

Challenge task 3 of 3 Add labels for the two checkboxes that say "Fast Shipping" and "Subscribe to Newsletter". Then add line breaks after the labels. Challenge task 3 of 3 gives me this response: Bummer! You need to add a <label> element with its "for" attribute set to "shipping" within the <form> element. The 'review yields the desired result...here is my code block:

        ```<input type="checkbox" id="shipping" value="fast_shipping">
  <label class="light" for  shipping>Fast Shipping</label><br>
  <input type="checkbox" id="newsletter" value="subscribe">
  <label class="light" for  newsletter>Subscribe to Newsletter</label><br>

    ```
Charles Harpke
Charles Harpke
33,986 Points

This code passes...I wasn't sure if the class type was necessary: <input type="checkbox" id="shipping" value="fast_shipping"> <label for = shipping>Fast Shipping</label><br> <input type="checkbox" id="newsletter" value="subscribe"> <label for = newsletter>Subscribe to Newsletter</label><br>

2 Answers

Eric Vandenberg
Eric Vandenberg
9,095 Points

You need to use ="" to select the id you want to set your label to by using the for attribute before the class attribute. Try this...

  <input type="checkbox" id="shipping" value="fast_shipping"><label for="shipping" class="light">Fast Shipping</label><br>


  <input type="checkbox" id="newsletter" value="subscribe"><label for="newsletter" class="light">Subscribe to Newsletter</label><br>
Charles Harpke
Charles Harpke
33,986 Points

That works...Thank you.