Good day. Who can help me with a problem in the assignment? Here is the assignment:
Step 56 There is another way to bind the input element text with the element itself. You can insert the text into the label element and add an attribute for with the same value as the id attribute of the input element.
Bind the text Loving with the flag by inserting only the text Loving into the label element and giving it the corresponding for attribute.
And here is my solution: <label for="loving"><input id="loving" type="checkbox">Loving</label>.
The question is why the program considers that I did not complete the task correctly and does not let me continue. I have looked at several examples on websites, and I do not see any errors in my syntax.
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.
I can’t understand what is required of me. The assignment clearly states: “You can insert text into the label element and add an attribute for with the same value as the id attribute of the input element.” I did that, but it doesn’t work.
I figured it out. The error is not obvious. Why should there be a space between the angle brackets, if it was not required earlier and was not considered an error?
The space was already there. You deleted it even though the instructions did not tell you to do that. Making changes the instructions don’t ask for is risky, as it can cause your code to fail.
Here is the option that was credited to me as correct : <input id="loving" type="checkbox"> <label for="loving">Loving</label> I still don’t really understand why it is this way, but I will keep it in mind. Thank you for taking the time to help me.