DrSchool Learn coding, fast.
EN AR BN CS DE EL Search

HTML: Forms

Learn Forms in HTML with practical examples.

Read time: 1 min Words: 47
Open Playground → HTML My Progress

HTML — Forms

Overview

HTML forms collect user input and send it to a server.

What you'll learn

  • Form structure
  • Input types
  • Labels & accessibility
  • GET vs POST

Syntax

<form action="/submit" method="post">...</form>

Example

<!-- Simple form -->
<form action="/submit" method="post">
  <label for="name">Name</label>
  <input id="name" name="name" type="text" required>

  <label for="email">Email</label>
  <input id="email" name="email" type="email" required>

  <button type="submit">Send</button>
</form>

Notes

  • Always connect
  • Use required and proper input types.

    Try: Open the Playground: /en/playground/html