Learn HTML Forms by Building a Registration Form - Step 26

Tell us what’s happening:
Describe your issue in detail here.

Ok so I passed this one but I want to know something

On the previous step I added < input type=“radio”> < / input> and then when it gets to the new step it changes it to < input type=“radio” / > and removes the < / input> WHY?

Because in another previous step it asks me to add REQUIRED in the INPUT but you have to remove the / in order for it to pass but the slash is generated for you but it never brings that to your attention untill you figure it out, know why, or learn that.

Thanks

Your code so far

<!-- file: index.html -->
  <fieldset>
        <label><input type="radio" /> Personal Account</label>
        <label><input type="radio" /> Business Account</label>
        <label><input type="checkbox" required! /> I accept the terms and conditions</label>
      </fieldset>
      TYPO ADDED ON PURPOSE TO ASK QUESTION - THIS PASSED
/* file: styles.css */
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
}

label {
  display: block;
  margin: 0.5rem 0;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36

Challenge: Learn HTML Forms by Building a Registration Form - Step 26

Link to the challenge:

Because it’s a self-closing tag, therefore it doesn’t need the closing tag.

Because in another previous step it asks me to add REQUIRED in the INPUT but you have to remove the / in order for it to pass but the slash is generated for you but it never brings that to your attention untill you figure it out, know why, or learn that.

The forward slash in self-closing tags isn’t required in HTML5.

1 Like

Isn’t required? So it can be there or not be there and its still valid?

The lesson automatically changes it for you but doesn’t bring that fact to your attention. So as a NEWB it could be confusing later because you (whoever is taking the lesson) didn’t do that and it got auto changed.

You did to an extent answer my question (thanks) but my main concern is it did it without kinda explaining it. I do understand it cleans up alot of stuff for you and even at times rearranges stuff to make it look more clean (happy about that).

But in a lesson that / was just there and needed to be removed in order to pass the test, so it just kinda flew under the radar until I explored a little.

Hope this clarifies.

Thanks

Isn’t required? So it can be there or not be there and its still valid?

Correct, the forward slash in a self-closing tag doesn’t have an effect.

But in a lesson that / was just there and needed to be removed in order to pass the test, so it just kinda flew under the radar until I explored a little.

That’s strange. I haven’t experienced that issue yet.

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