The field with id="email" is not inside the form element

Hi coders…I have been struggling all week trying to resolve this error and I have looked at other codepen examples for the survey project and can’t get pass this error. I don’t what I should be typing and where to put id=“email” inside the form because clearly its listed. Please take a look and provide feedback.

Well the only 2 things I see is that <label for="email-label"... does not have a closing tag. And if your label for email is called email-label than the id should be id="email-label".

I think you have a bunch of mismatches of your opening and closing tags. In CodePen you can run “Analyze HTML” and it will help you find your errors.

When tags aren’t closed properly, or are closed in the wrong order, it can result in things like nesting not being interpreted correctly.

2 Likes

ok, so. you need to go back through your code, starting at line 1, and verify that every opening tag has a closing tag and that the hierarchies are correct. there are a lot of random closing tags that im not sure even have an opening tag. it just needs to be cleaned up.

Here is an example of what i mean by “hierarchies are correct” and what that looks like:

BAD:

<div>
<p>
</div>
</p>

GOOD:

<div>
<p>
</p>
</div>
2 Likes

I changed it and received more errors. I guess I’m not sure how to put "id=email in form? Its listed but maybe not in the right place.

I’m still seeing a lot of html errors in your project:

1 Like

ok that’s super neat. where do i find that in codepen?

There’s a small button in the top-right of the HTML section that has various formatting and analyzing tools:

2 Likes

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