Learn HTML Forms by Building a Registration Form - Step 18

Following accessibility best practices, link the input elements and the labelelements together using the forattribute.

Use first-name, last-name, email, and new-password as values for the respective id attributes.
I don’t know how to link label and input with for? I’ve tried removing the input, id, for attributes

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Registration Form</title>
    <link rel="stylesheet" href="styles.css" />
  </head>
  <body>
    <h1>Registration Form</h1>
    <p>Please fill out this form with the required information</p>
    <form method="post" action='https://register-demo.freecodecamp.org'>
      <fieldset>
        <label>Enter Your First Name: <input id for="first-name"/></label>
        <label>Enter Your Last Name: <input id for="last-name" /></label>
        <label>Enter Your Email: <input id for="email"/></label>
        <label>Create a New Password: <input id for="new-password" /></label>
      </fieldset>
      <fieldset></fieldset>
      <fieldset></fieldset>
    </form>
  </body>
</html>

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

Link to the challenge:

This is the Step you should review:

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