What's wrong with my code? (about radio button)

The requirement is:
Add a pair of radio buttons to your form, each nested in its own label element. One should have the option of indoor and the other should have the option of outdoor. Both should share the name attribute of indoor-outdoor to create a radio group.

My codes:
<form action="/submit-cat-photo">

<input id=“indoor” type=“radio” name=“indoor-outdoor”>

<label for=“indoor”>Indoor<button type=“submit” name=“indoor-outdoor”>Submit</button>

</label>

<input id=“outdoor” type=“radio” name=“indoor-outdoor”>

<label for=“outdoor”>Outdoor<button type=“submit” name=“indoor-outdoor”>Submit</button>

</label>

</form>

I can’t pass the challenge, the test result is:
// running tests

Give your radio buttons the name attribute of indoor-outdoor.

Each of your two radio button elements should be nested in its own label element.

// tests completed

What’s going wrong?:thinking:

I can see some typos here.

1 Like

I corrected the typo, still dosn’t work.:upside_down_face:

Name of the exercise?

The radio buttons are not nested in Maude the labels, and you have too many buttons

try the code below I have nested the input inside the label as the question requested and have not used any submit buttons as the question does not state that.

Indoor
Outdoor
1 Like

How to edit that? Doesn’t it requests tow buttons?

You just need one button element for all the form - You don’t need a button element for each input of type radio - here for each radio button you need a input element and a label element, with the appropriate attributes

1 Like

I tried, autally it dosn’t request button!