×

html · level 1 · unit 7 · lesson 2

  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

type changes the box, and sends the form.

The type attribute changes what an input is for. type="email" expects an email address, type="number" expects a number, and makes a checkbox to tick.

A button is something people press to make things happen. Inside a form, <button> sends the form when clicked. Its words go between its tags, so say what happens, like Join the club.

For a checkbox, put the label after the box, so the tick sits on the left of its words.

<form>
  <label for="age">Age</label>
  <input type="number" id="age">
  <input type="checkbox" id="news">
  <label for="news">Send me news</label>
  <button>Join the club</button>
</form>

Press show my page to see it here.

Button words should say what happens, like Join the club, not only OK.