# Learn HTML Forms by Building a Registration Form - Step 18

**URL:** <https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378>\
**Category:** Curriculum Help\
**Tags:** html, css\
**Created:** [November 23, 2022, 8:57am UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378 "2022-11-23T08:57:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![elatajr](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/elatajr/32/292995_2.png) [@elatajr](https://forum.freecodecamp.org/u/elatajr)\
**Post date:** [November 23, 2022, 8:57am UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/1 "2022-11-23T08:57:38Z")

</div>

I added the input element with a for attribute. Hint: The first label element should have a for attribute with a value of first-name. I didn’t see any other posts for this. I know I will have to mirror the same for the other labels.

```auto
      <fieldset>
        <label>Enter Your First Name: <input id="first-name" for="first-name"</label>
        <label>Enter Your Last Name: <input id="last-name"/></label>
        <label>Enter Your Email: <input id="email"/></label>
        <label>Create a New Password: <input id="new-password"/></label>
      </fieldset>

```

---

<div class="post-metadata">

**Author:** ![hbar1st](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/hbar1st/32/372649_2.png) [@hbar1st](https://forum.freecodecamp.org/u/hbar1st)\
**Post date:** [November 23, 2022, 8:59am UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/2 "2022-11-23T08:59:51Z")

</div>

A label is not an input.  
The for attribute belongs in the label, not the input.

---

<div class="post-metadata">

**Author:** ![elatajr](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/elatajr/32/292995_2.png) [@elatajr](https://forum.freecodecamp.org/u/elatajr)\
**Post date:** [November 23, 2022, 9:28am UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/3 "2022-11-23T09:28:17Z")

</div>

Thanks for the tip. I moved the for attribute outside of the input element. Hint: The first label element should have a for attribute with a value of first-name. When I try and write the code here, it doesn’t show up.

---

<div class="post-metadata">

**Author:** ![hbar1st](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/hbar1st/32/372649_2.png) [@hbar1st](https://forum.freecodecamp.org/u/hbar1st)\
**Post date:** [November 23, 2022, 11:13am UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/4 "2022-11-23T11:13:49Z")

</div>

I can’t see your code. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (').

---

<div class="post-metadata">

**Author:** ![elatajr](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/elatajr/32/292995_2.png) [@elatajr](https://forum.freecodecamp.org/u/elatajr)\
**Post date:** [November 24, 2022, 9:39pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/5 "2022-11-24T21:39:36Z")

</div>

@hbar1st thank you for the information. I have added the updated code. The for attribute is not in the input element. It doesn’t look right. Not completely understanding the for attribute: for=“value”\>Value

```auto
<label>Enter Your First Name: <input id="first-name"/> for="first-name"</label>

```

---

<div class="post-metadata">

**Author:** ![hbar1st](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/hbar1st/32/372649_2.png) [@hbar1st](https://forum.freecodecamp.org/u/hbar1st)\
**Post date:** [November 24, 2022, 9:42pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/6 "2022-11-24T21:42:36Z")

</div>

literally cut the text of the for attribute out and place it right next to the word label (with one space in between) inside the `<label>` tag please.

---

<div class="post-metadata">

**Author:** ![elatajr](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/elatajr/32/292995_2.png) [@elatajr](https://forum.freecodecamp.org/u/elatajr)\
**Post date:** [November 24, 2022, 9:54pm UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/7 "2022-11-24T21:54:52Z")

</div>

@hbar1st, thank you for your time and patience. I understand now.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [May 26, 2023, 9:55am UTC](https://forum.freecodecamp.org/t/learn-html-forms-by-building-a-registration-form-step-18/573378/8 "2023-05-26T09:55:01Z")

</div>

Closed on May 26, 2023, 9:55am UTC

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