Basic HTML and HTML5 - Create a Set of Radio Buttons

Tell us what’s happening:
Describe your issue in detail here.
Each of your two radio button elements should be nested in its own label element >how do i do that

  **Your code so far**
<p>Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="" alt="A cute orange cat lying on its back."></a>

<p>Things cats love:</p>
  <li>cat nip</li>
  <li>laser pointers</li>
<p>Top 3 things cats hate:</p>
  <li>flea treatment</li>
  <li>other cats</li>
<form action="">
<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>
  **Your browser information:**

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

Challenge: Basic HTML and HTML5 - Create a Set of Radio Buttons

Link to the challenge:

The pattern you are using to create the labels isn’t the one requested.
The pattern you need to pass this exercise is this one:

<label for="indoor"> 
  <input id="indoor" type="radio" name="indoor-outdoor">Indoor 

Notice the differences:
=> In the correct sample code, there is only one label element for one radio button.
So in the correct solution code, there should be two label elements respectively for the two radio buttons.
=> In the correct sample code, the text of the button “Indoor” is placed directly after the input element. While in your solution, you placed the text after the label element.

So to correct this, just copy the sample code to the working area twice.
Then make minor correction to the sample code to make one radio button say indoor and the other say outdoor (with correct ids attributes and for attributes).

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.