Make sure each of your label elements has a closing tag

Tell us what’s happening:
Describe your issue in detail here.
All of my label elements have a closing tag. I’m not able to move forward because of the error msg" Make sure each of your label elements has a closing tag."

  **Your code so far**
 <label 
    for="mean"><input id="mean" type="checkbox" name="personality"> Mean
    </label>
    <label
     for="sleepy"><input id="sleepy" type="checkbox" name="personality"> Sleepy
     </label>

<h2>CatPhotoApp</h2>
<main>
<p>Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="https://www.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="https://www.freecatphotoapp.com/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>
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button></label>
  <label
   for="loving"><input id="loving" type="checkbox" name="personality"> Loving
   </label>
  <label 
  for="mean"><input id="mean" type="checkbox" name="personality"> Mean
  </label>
  <label
   for="sleepy"><input id="sleepy" type="checkbox" name="personality"> Sleepy
   </label>
</form>
</main>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15

Challenge: Create a Set of Checkboxes

Link to the challenge:

You can’t put an input element within a label element, it is label tag first before input element or the order way around.

I don’t understand what to correct.??

Looking at your code I see you’ve added the checkboxes after the submit button.
There’s nothing wrong with that as far as the tests are concerned.

The issue is that right after the closing button tag there is a closing label tag that you added. It shouldn’t be there as there is no opening label tag so the error message is correct.
If that is removed, the tests will pass.

This is specific code that @Roma refer to.

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