Can't solve this error

I’m trying to do the html projects. I’m at the product landing page. You can see the errors i get here and the code https://codepen.io/krylol/pen/ZELweGR. I can’t pinpoint any errors. Everything the web is asking for it’s done so i don’t know what’s wrong. I have an input with ID=“email” i used required so it will ask for an email and i have a submit input with id=sumbit. Anyone knows what to do?

The failing test is telling you what is wrong:

  1. Within the form, there is an field with id=“email” where I can enter an email address.

#email should be a child of the #form element : expected 0 to equal 1 AssertionError: #email should be a child of the #form element : expected 0 to equal 1

And this is your code:

 <div>
  <form id="form" action="https://www.freecodecamp.com/email-submit">
  </form>
  <input type="text" name="email" id="email" placeholder="enter your email" required>
  <input id="submit" type="submit" value="Let's go">
</div>

Note that #id is not a child of #form, but is a sibling. The test (presumably) is looking for an input element with an id of “email” that is a child of the form. It can’t find it.

If I fix that (putting the inputs inside the form, where they should be), then a few more tests start passing.

Read the error messages, they are there to help you.

1 Like

Thank you. Now everything is working. I didn’t read the messages and i was getting a bit mad because i couldn’t find the error. Next time i will read the errors and my code. Thank you i was really stuck in that part.

Yeah, getting frustrated is just part of programming. And so is learning to focus on tiny details. I’m glad it worked out.

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