Lazo Lab Sign up

Web Development / HTML

Lesson 6 of 30

Forms

Forms collect input. Each input needs a <label> so users and screen readers know what it's for.

Key points

  • <label for> matches the input's id
  • type=email, password, number
  • required makes a field mandatory
<form method="post">
  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>
  <button>Send</button>
</form>
Watch a video on thisOpens YouTube search results for “Forms” in a new tab

Quiz · +10 XP

Why should every input have a <label>?

Log in to save progress and earn XP.