Each of your `label` elements should have a closing tag

Tell us what’s happening:
Hi i am stuck on making radio buttons it keeps hanging on Each of your label elements should have a closing tag.

  **Your code so far**
<form>
<label><label for="indoor">
<input type="radio"name="indoor-outdoor">Indoor
</label>
<label>
<label for="outdoor">
<input type="radio"name="indoor-outdoor">Outdoor</label>
<button type="submit">Submit</button>
</form>
  **Your browser information:**

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

Challenge: Create a Set of Radio Buttons

Link to the challenge:

Look at your code carefully. The error message is telling you what’s wrong.

You have four (4) opening label tags and two (2) closing label tags. Are the two that don’t have attributes necessary?

On a side note;

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

Hi Roma

I am completely new to code, i have changed it but the error remains that each of my label elements should have a closing tag, i can't seem to see what i am doing wrong
<label for="Indoor">
<input type="radio"name="indoor-outdoor">Indoor
</label>
  <label for="Outdoor">
<input type="radio"name="indoor-outdoor">Outdoor</label>

Your code passes for me (provided this snippet is in the form element and you only have the one form element. You may have to reset the lesson and try again.

Although it will not cause the test to fail you should be aware that there should be a space between attributes. That is rather than;
<input type="radio"name="indoor-outdoor">
it should be;
<input type="radio" name="indoor-outdoor">

thank you

Resetting the lesson was the key

1 Like

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