HTML 5 · Forms

Build a form

Label every control. The for attribute matches the input's id.

<form action="/subscribe" method="post">
  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>
  <button type="submit">Subscribe</button>
</form>

Official HTML 5 documentation

More forms commands

All forms commands · HTML 5 cheatsheet

Was this page helpful?