My html code fails to pass

Step 56

There’s another way to associate an input element’s text with the element itself. You can nest the text within a label element and add a for attribute with the same value as the input element’s id attribute.

Associate the text Loving with the checkbox by nesting only the text Loving in a label element and giving it an appropriate for attribute.

*my code below fails to pass as per the instructions above
*

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

I’ve edited your code 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 (').

going by memory, the text Loving should be after the input element, not before.

But please, when you ask for help always post the link to the step, if you use the Ask for help button, that always include that

1 Like

Learn HTML by Building a Cat Photo App: Step 56 | freeCodeCamp.org

@ilenia remembers correctly.
You just need to swap the order of the label and input elements. The input should come first and the label immediately after, with a space separating the two elements.

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