freeCodeCamp/curriculum/challenges/italian/14-responsive-web-design-22/learn-html-forms-by-buildin.../60f805f813eaf2049bc2ceea.md

2.5 KiB

id title challengeType dashedName
60f805f813eaf2049bc2ceea Step 17 0 step-17

--description--

Annida un elemento input in ogni elemento label. Assicurati di aggiungere ogni elemento input dopo il testo label e di includere uno spazio dopo i due punti.

--hints--

Dovresti aggiungere quattro elementi input all'elemento fieldset.

assert.equal(document.querySelectorAll('fieldset input')?.length, 4);

Dovresti annidare gli elementi input all'interno degli elementi label.

assert.equal(document.querySelectorAll('label input')?.length, 4);

Dovresti aggiungere il primo input il testo Enter Your First Name: dell'elemento label e includere uno spazio dopo i due punti.

assert.equal(document.querySelectorAll('label')?.[0]?.innerHTML.trim(), 'Enter Your First Name: <input>');

Dovresti aggiungere il secondo input dopo il testo Enter Your Last Name: dell'elemento label e includere uno spazio dopo i due punti.

assert.equal(document.querySelectorAll('label')?.[1]?.innerHTML.trim(), 'Enter Your Last Name: <input>');

Dovresti aggiungere il terzo input dopo il testo Enter Your Email: dell'elemento label e includere uno spazio dopo i due punti.

assert.equal(document.querySelectorAll('label')?.[2]?.innerHTML.trim(), 'Enter Your Email: <input>');

Dovresti aggiungere il quarto input dopo il testo Create a New Password: dell'elemento label e includere uno spazio dopo i due punti.

assert.equal(document.querySelectorAll('label')?.[3]?.innerHTML.trim(), 'Create a New Password: <input>');

--seed--

--seed-contents--

<!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'>
  --fcc-editable-region--
      <fieldset>
        <label>Enter Your First Name:</label>
        <label>Enter Your Last Name:</label>
        <label>Enter Your Email:</label>
        <label>Create a New Password:</label>
      </fieldset>
--fcc-editable-region--
      <fieldset></fieldset>
      <fieldset></fieldset>
    </form>
  </body>
</html>
body {
  width: 100%;
  height: 100vh;
  margin: 0;
  background-color: #1b1b32;
  color: #f5f6f7;
}

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