DAZPY
October 10, 2020, 7:59pm
1
This is my code and I’m having problems.
it says that each of my 3 checkbox elements should be nested in its own label element but I don’t see the problem
<main>
<form>
<label for="loving"><input id="loving" type="checkbox" name="personality">Loving </label>
<label for="impulsive"><input id="impulsive"><input id="impulsive" type="checkbox" name="personality">impulsive </label>
<label for="dominant"><input id="dominant"><input id="dominant" type="checkbox" name="personality">dominant </label>
</form>
</main>
It would be easier to help you with a link to the challenge.
Anyway, looking at what you provided, like here:
<label for="impulsive"><input id="impulsive"><input id="impulsive" type="checkbox" name="personality">impulsive </label>
Why are there two input
elements in there?
DAZPY
October 10, 2020, 8:45pm
3
I’m trying to make 3 check boxes with their own element here is the link https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/create-a-set-of-checkboxes
<label for="loving"><input id="loving" type="checkbox" name="personality">Loving </label>
<label for="impulsive"><input id="impulsive"><input id="impulsive" type="checkbox" name="personality">impulsive </label>
<label for="dominant"><input id="dominant"><input id="dominant" type="checkbox" name="personality">dominant </label>
Read Kevin’s answer again:
Anyway, looking at what you provided, like here:
<label for="impulsive"><input id="impulsive"><input id="impulsive" type="checkbox" name="personality">impulsive </label>
Why are there two input
elements in there?
DAZPY
October 10, 2020, 8:57pm
5
When I look at my code there is actually 3 but they are in their own label, I’m trying to make 3 check boxes in their own element, for me to create the name of those 3 check boxes it tells me I need to use 3 inputs in 3 different elements.
You need one input per label. You have got 2 inputs in the one label above.
Right, if I take this line:
<label for="impulsive"><input id="impulsive"><input id="impulsive" type="checkbox" name="personality">impulsive </label>
and break it apart, you get:
<label for="impulsive">
<input id="impulsive">
<input id="impulsive" type="checkbox" name="personality">impulsive
</label>
Do you see the problem?
When I remove the superfluous input
elements, this passes for me.
DAZPY
October 12, 2020, 9:29pm
9
Yeah I fixed it it’s all good thank you and have a good day!!! The things was that I wrote the code twice not the entire code but the input part thank you for helping me though stay safe and have a good day!!!
DAZPY
October 12, 2020, 9:30pm
10
Thank you very much I couldn’t reply because it’s a new account and I have a limit, but appreciate the help, stay safe and have a good day!!!