HTML Forms

What are Forms?

HTML forms are used to collect user input.

Example

<form>
  <label>Name:</label><br>
  <input type="text" placeholder="Enter your name"><br><br>

  <label>Email:</label><br>
  <input type="email" placeholder="Enter email"><br><br>

  <label>Password:</label><br>
  <input type="password" placeholder="Enter password"><br><br>

  <button type="submit">Submit</button>
</form>
Try it Yourself

<form>

Form container

<input>

User input field

<button>

Submit button

Live Preview

Summary