Create a Set of Radio Buttons ... what's the problem in my code

Mycode 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 type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
    <label>
      <input type="radio" name="indoor-outdoor">Indoor
      <input type="radio" name="indoor-outdoor">Outdoor
    </label>
  </form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:


when I’m running the code it says :

Each of your two radio button elements should be nested in its own label element.

so, what’s the problem ??
I couldn’t understand where’s the wrong.

isn’t it self-closing ??
can you write for me the right way? :pray:t2: :pray:t2:

You put your two inputs inside one label, they must be inside on their on label, one label for each input:
<label><input></label>

3 Likes
type or paste code here
```<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">
    <label for="indoor"><input id="indoor" type="radio" name="indoor-outdoor"> Indoor</label>
    <label for="outdoor"><input id="outdoor" type="radio" name="indoor-outdoor"> Outdoor</label><br>
    <input type="text" placeholder="cat photo URL" required>
    <button type="submit">Submit</button>
  </form>
</main>
1 Like

ahaaaa … so that’s my wrong !!
thank you so much !! :heart_eyes:

everyone of theme must be on his ouwn label

2 Likes

thank you sooooo much :heart_eyes::heart_eyes::relaxed::relaxed: :hibiscus: :hibiscus:

yes thank you :hibiscus: :hibiscus: ~(@^-^@)~

pleasemark my response us apt

1 Like

you are welcome :wink: :grinning:

1 Like

please mark my response as a solution