Stock at html form adding checkbox.need help!

*am stock at html form checkbox specifically kindly need someone to put me through.

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">
  <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>

  <label for="loving"><input id="loving"type="checkbox"name="personality">loving</label>
  <label for="sleepy"><input id="sleepy"type="checkbox"name="personality">sleepy</lable>
  <label for="mean"><input id="mean"type="checkbox"name="personality">mean</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 6.1; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0.

Challenge: Create a Set of Checkboxes

Link to the challenge:
https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes

Look better the closing label tags

1 Like

<label for="Loving"><input type="checkbox" id="loving" name="personality"> Loving</label>
<label for="Loving"><input type="checkbox" id="loving" name="personality"> Loving</label>
<label for="Loving"><input type="checkbox" id="loving" name="personality"> Loving</label>

Every check box should have " Loving".

no, it doesn’t, each checkbox must be different from the others

Check the closing tag for your 2nd checkbox “sleepy”. It’s </lable> instead of </label>

just try to copy past mine and it will work. I solved challenge again for you it its the right way,

thanks really appreciate!!

@ahmadkakarr it does pass the test but it really isn’t correct.

  1. It makes no sense having three checkboxes with the same option.

  2. You have broken the association between the labels and inputs. A) They can not share the same for/id and B) you have a capital “L” letter on the for and a lowercase case “l” on the id.

  3. Using the same id more than one time is not valid.

The original code was almost correct, but as said, it had one typo on one of the closing label tags.

1 Like

The error was in a typo in one of the closing label tags.

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