HTML Forms Basics

Forms collect user input using <form>, <input>, and other elements.

Key Elements

  • <form>: Container for form elements
  • <input>: Input fields (e.g., text, email)
  • <label>: Labels for inputs
  • <button>: Submits the form
HTML
<form> <label for="name">Name:</label> <input type="text" id="name"> </form>

Your Task

Create a contact form with:

  1. A text input for name
  2. An email input
  3. Labels for both inputs
  4. A submit button
AI Learning Assistant

Live Preview