Learn HTML by Building a Cat Photo App - Step 56

Tell us what’s happening:
Describe your issue in detail here.
Where and how should I add the for attribute? Is it or for=?
Your code so far

        <h2>Cat Photos</h2>
        <!-- TODO: Add link to cat photos -->
        <p>See more <a target="_blank" href="https://freecatphotoapp.com">cat photos</a> in our gallery.</p>
        <a href="https://freecatphotoapp.com"><img src="https://cdn.freecodecamp.org/curriculum/cat-photo-app/relaxing-cat.jpg" 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="https://cdn.freecodecamp.org/curriculum/cat-photo-app/lasagna.jpg" 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="https://cdn.freecodecamp.org/curriculum/cat-photo-app/cats.jpg" alt="Five cats looking around a field.">
          <figcaption>Cats <strong>hate</strong> other cats.</figcaption>  
        <h2>Cat Form</h2>
        <form action="https://freecatphotoapp.com/submit-cat-photo">
            <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>

<!-- User Editable Region -->

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

<!-- User Editable Region -->

          <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/ Safari/537.36 Edg/116.0.1938.62

Challenge: Learn HTML by Building a Cat Photo App - Step 56

Link to the challenge:

Attributes go on the opening tag. For example, you have added the type attribute and id attribute to the input tag. You would use the same format to add the for attribute to the label element.

I still don’t understand it. I just did in the same format as the input and it still comes up wrong.

You need to show us what you did by pasting your updated code in here using the following method.

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

I just did what you asked with the backticks. Don’t know if it worked. This is what I did though. for=“loving” Loving

It didn’t work :slightly_frowning_face:

You can always click the </> button in the menu bar at the top of this editor window to get the triple back ticks. And then replace the string “type or paste code here” with your code.

I don’t see </> in the menu drop down. <input id="loving" type="checkbox"> <label> for="loving" Loving</label> This is the code here.

Ok I got it. It wasn’t what I expected.

The for attribute goes on the opening label tag. Similar to how you added the id and type attribute to the opening input tag.

When you are typing in the editor in these forums, do you see a bunch of buttons at the top of the text box you are typing into? One of those is the </> button.

Yes, here I see it now. I’m on the next and i’m lost. I will most likely be posting for help soon.

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