What is my error? 'Each of your label elements should have a closing tag.'

Tell us what’s happening:

  **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="https://freecatphotoapp.com/submit-cat-photo">
  <input type="text" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>

  <label>
  <label for="indoor">
    <input id="indoor" type="radio" name="indoor-outdoor">Indoor
    </label>
    <label>
    <label for="outdoor">
      <input id="outdoor" type="radio" name="indoor-outdoor">Outdoor
      </label>
</form>
</main>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36.

Challenge: Create a Set of Radio Buttons

Link to the challenge:

Hi, from what I can see within your form tags you have two tags that don’t really need to be there. Line 23 and Line 27 or the tags without the “for” attribute, try getting rid of them.

Hey there @vikshay_ronald !

You have some stray <label> tags. Take a look at this snippet:


  <label>*ok cool*
  <label for="indoor">
    <input id="indoor" type="radio" name="indoor-outdoor">Indoor
    </label>
    <label>*where's the slash?*

once you fix that your good to go!

Best,
Cy499_Studios

Hi thank you very much this worked!

1 Like

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