×

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

The right type gives visitors the right tools.

You met email, number and checkbox. There are more. type="tel" is for phone numbers, so phones show a instead of letters. type="url" is for web addresses.

type="date" opens a , a little calendar, so nobody has to wonder whether you want the day or the month first. type="time" does the same for times.

type="password" hides each letter behind a dot, so people nearby cannot read it. The right type costs you nothing and saves every visitor effort.

<form>
  <label for="phone">Phone</label>
  <input type="tel" id="phone" name="phone">
  <label for="day">Day</label>
  <input type="date" id="day" name="day">
  <label for="secret">Password</label>
  <input type="password" id="secret" name="secret">
</form>

Press show my page to see it here.

Leave type out, or write type="text", and you get the ordinary box. Browsers that do not know a type show that too.