*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
Ndims
December 31, 2019, 1:03am
2
Look better the closing label tags
1 Like
ayanaba1:
checkbox
<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".
ilenia
December 31, 2019, 7:54am
4
ahmadkakarr:
<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.
It makes no sense having three checkboxes with the same option.
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
.
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.
ilenia
Closed
March 24, 2021, 5:01pm
10
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.