Confused about Check Radio Buttons and Checkboxes by Default

Hello, I am new to programming and I get confused very easily, I am not sure what is happening, in the challenge I am asked to set the first of your radio buttons and the first of your checkboxes to both be checked by default with the requirements of

  • Your first radio button on your form should be checked by default.
  • Your first checkbox on your form should be checked by default.
  • You should not change the inner text of the Indoor label.
  • You should not change the inner text of the Loving label.

The last two I am not complying with and I have not touched those internal texts or at least I think so, I hope your help, thank you very much

   **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="radio" name="test-name" checked>
 <label><input type="radio" name="indoor-outdoor"> Indoor</label>
 <label><input type="radio" name="indoor-outdoor"> Outdoor</label>
 <label><input type="checkbox" name="personality" checked> Loving</label>
 <label><input type="checkbox" name="personality"> Lazy</label>
 <label><input type="checkbox" name="personality"> Energetic</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 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36

Challenge: Check Radio Buttons and Checkboxes by Default

Link to the challenge:

You changed several things about the labels and the inputs that you shouldn’t have.
For example, the original code in the challenge for the first form item is:

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

but you changed it to:

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

You have also added a random additional radio button at the beginning of the form, which doesn’t belong there.

1 Like

You have the right Idea, and this Question is a little Tricky, and so it is an Easy one to get confused on:

Go ahead and hit the RESET BUTTON. As Ariel said, there are a few pieces of code that are out of place. Sometimes, it’s a good idea to use the RESET BUTTON to reset the code if you are having continuous problems, and can’t figure out why.

THE TUTORIAL SAYS TO: Set the first of your radio buttons and the first of your checkboxes to both be checked by default.


This is the first radio button:

Screenshot 2022-04-05 11.19.04 AM

This is the first checkbox:
Screenshot 2022-04-05 11.19.11 AM


This is what it looks like to have both of them checked

image

1 Like

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