×

html · level 2 · unit 1 · 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

Every needs a name, or its answer is never sent.

Each question on a form is a field: a label and a box. When someone presses the button, the browser packs up the answers and sends them to a , the computer that stores the website and reads its forms.

The browser only sends answers that have a name. Each one travels as a pair, like email=sam@example.com. The label is for people. The name is for the server.

On the <form> tag, action gives the address that receives the answers. method="post" sends them tucked out of sight, instead of in the address bar.

<form action="https://example.com/join" method="post">
  <label for="email">Email</label>
  <input type="email" id="email" name="email">
  <button>Join</button>
</form>

Press show my page to see it here.

id joins the label to its box, and name labels the answer for the server. They are often the same word.