×

html · level 1 · unit 7 · lesson 1

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

makes a box that visitors can type in.

A is a part of a page that asks visitors for information, like a sign-up sheet. Wrap it in <form>. An <input> makes a box to type in. It is empty, so no closing tag.

Every input needs a : words that say what to type. Use <label>, and give it a for attribute that matches the input's id.

Then clicking the words puts you straight into the box, and screen readers read the label out loud. Without one, the box is a mystery.

<form>
  <label for="pet">Your pet's name</label>
  <input id="pet">
</form>

Press show my page to see it here.

The for and the id must match exactly, like the two halves of a ticket.