Codeloft
0 0 XP

Forms that collect input

8 min 20 XP + 10 for no hints

Forms let visitors type information. <input> makes a box to type in, and type="email" tells phones to show the email keyboard.

Every input needs a <label>. When the label's for attribute matches the input's id, clicking the label puts the cursor in the box, and screen readers announce the label.

A <button> inside the form sends it.

Example
<form>
  <label for="name">Your name</label>
  <input id="name" type="text">
  <button>Send</button>
</form>
Ids must be unique on the page. Pick a clear one like id="email".

Your tasks

0 of 3 done
  1. Add an input with an id
  2. Add a <label> whose for matches that input's id
  3. Add a button that submits the form

Quick check

Why match a label's for to an input's id?

signup.htmlUpdates as you type