Help with why my label is showing an error?

Tell us what’s happening:
I keep getting this error:

The text Loving should be nested within the new label element. You have either omitted the text or have a typo.
not sure what im doing wrong in this instance. any help is greatly appreciated thank you!

  **Your code so far**
      <h2>Cat Photos</h2>
      <!-- TODO: Add link to cat photos -->
      <p>Click here to view more <a target="_blank" href="">cat photos</a>.</p>
      <a href=""><img src="" alt="A cute orange cat lying on its back."></a>
      <h2>Cat Lists</h2>
      <h3>Things cats love:</h3>
        <li>cat nip</li>
        <li>laser pointers</li>
        <img src="" alt="A slice of lasagna on a plate.">
        <figcaption>Cats <em>love</em> lasagna.</figcaption>  
      <h3>Top 3 things cats hate:</h3>
        <li>flea treatment</li>
        <li>other cats</li>
        <img src="" alt="Five cats looking around a field.">
        <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
      <h2>Cat Form</h2>
      <form action="">
          <legend>Is your cat an indoor or outdoor cat?</legend>
          <label><input id="indoor" type="radio" name="indoor-outdoor" value="indoor"> Indoor</label>
          <label><input id="outdoor" type="radio" name="indoor-outdoor" value="outdoor"> Outdoor</label>
          <legend>What's your cat's personality?</legend>
          <input id="loving" type="checkbox"> 
          <label for="loving" </label>
        <input type="text" name="catphotourl" placeholder="cat photo URL" required>
        <button type="submit">Submit</button>
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.49

Challenge: Step 55

Link to the challenge:

Two issues

  1. you didn’t close the opening tag with >

  2. You don’t have any text inside of the label

1 Like

i placed the for attribute and nothing seems to happen even if i close the opening tag its weird. not sure what text to include inside the label?

What is your updated code?

You should put Loving between the label tags.

<label> for="loving"</label>

it keeps giving me the error that i need a for attribute

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

1 Like

two issues

  1. you orphaned the attribute outside of the opening label tag. Attributes must go inside of the <> like the other attributes you’ve written (src, href, target, etc)

  2. the text between the opening and closing tags must be exactly and only Loving

if the text between the opening and closing tags must be only loving, where would the for attribute go?

Inside of the opening tag. That’s where you’ve put attributes before.

<opening tag>Some Text</closing tag>
1 Like
<label for="loving" </label>

finally figured it out. thanks for your help had to change it up a bit but it passed!

1 Like

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