In the Radio Buttons when i gave them the same id= "outdoor" i have validated the test but the id must be unique?



  <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 type="text" placeholder="cat photo URL" required>

    <button type="submit">Submit</button>


  <label for="indoor-outdoor"> 

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


 <label for="indoor-outdoor"> 

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




Hello there.

Do you have a question?

If so, please edit your post to include it.

The more information you give us, the more likely we are to be able to help.

Your input ids should be different. One should be indoor and the other outdoor.

I think I know why your code is not working. I apologise if there are any mistakes on my wording - I’m not a native english speaker.

The for attribute inside the <label> element should have the same value as the id of the <input> element. In your code, these values are different - I suppose that you confounded id with name. Besides that, the id should not be indoor-outdoor, as this would be a more appropriate value value.
For the name attribute, I recommend using the text that this radio button would represent (“indoor”, in this case) as the value.
See here an article about the <label> element and its attributes, and here an article about <input>. These should give you a more detailed explanation.
id is an element identifier, and should be helpful in styling and important in situations like this. You’ll see that there are many other situations where it is used. The name, however, is the name of the form control.

So, the correct code would be:

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

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

You can post solutions that invite discussion (like asking how the solution works, or asking about certain parts of the solution). But please don’t just post your solution for the sake of sharing it.
If you post a full passing solution to a challenge and have questions about it, please surround it with [spoiler] and [/spoiler] tags on the line above and below your solution code.

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