Nested Radio Button Code

Hi Thank you . This is the best thing happened to code since code itself.

About Radio buttons code . You can see mine the browser also correctly illustrates the buttons but the error of Nested remains and does not pass the test. Obviously there are a few ways to get thins done in HTML thanks to find out what is the best way to do thin .Really curious . Please advise me what is the code which allows the test to pass? THX & RGDS

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 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/83.0.4103.106 Safari/537.36.

Challenge: Create a Set of Radio Buttons

Link to the challenge:

Welcome to the community !

You are not able to pass the test because the lesson says - each of the two radio buttons should have their “own” label tags.

<label> <input type="radio" name="indoor-outdoor" >indoor <input type="radio" name="indoor-outdoor" >outdoor </label>

See , you have nested both radio button elements within the same label tag.

1 Like