Label for attribute


Its asking me to wrap a label with the attribute “for” around the “Loving” word. Iv had a look on other websites and tried different things but dont seem to be getting it right. Any guidance to the below would be much appreciated.

<label for= "Loving" </label>

Its not putting the full line on the post for some reason but at the end i have a label closing tag

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 (').

this is not correct HTML, a tag to be complete must start with < and end with >

I have tried putting > at the end of “loving” but that dont work either

that would be a thing to do, after you have correct opening and closing tags, you will have to put the required text between the opening and closing tag

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

What the lesson is asking you to do is something similar to this:

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

Ah ok its correct now. So I have to make sure i put the word in quotation marks first basically. Thank you

look closer at the “Example” given, it has what you’re missing in your code

Yes. Also, the capitalization is important too. When you initially did it you had for="Loving" which is incorrect. The proper way it should be written is for="loving". Also, it is required to add some text to be displayed on the screen in this lesson as best practice which is why in my example I added Example between the opening and closing label elements.

Yes, that’s a lot clearer now. Thank you for your help.

1 Like

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