Create a Set of Radio Buttons98776

Tell us what’s happening:

hey guys!
I got a problem on my radio buttons! I did the same based on the videos many times, but all the time it shows that its wrong. THANKS, MUCH LOVE!

Your code so far


<h2>CatPhotoApp</h2>
<main>
  <p>Click here to view more <a href="#">cat photos</a>.</p>
  
  <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>
  
  <p>Things cats love:</p>
  <ul>
    <li>cat nip</li>
    <li>laser pointers</li>
    <li>lasagna</li>
  </ul>
  <p>Top 3 things cats hate:</p>
  <ol>
    <li>flea treatment</li>
    <li>thunder</li>
    <li>other cats</li>
  </ol>
  <form action="/submit-cat-photo">
  
    <input id="indoor" type="radio" name="indoor-outdoor">
    <label for= "indoor">Indoor</label>
    <input id="outdoor" type="radio" name="indoor-outdoor">
    <label for="outdoor">Outdoor</label>

    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.1 Safari/605.1.15.

You’re very very close. Only issue you have going on, the labels should wrap the input. so you would see something more like:

<label>Indoor <input type='radio' name='indoor-outdoor' id='indoor' ></label>

Doing this, you don’t need the for attribute on the label – it is assumed it’s the label for the input it wraps.

1 Like