HTML: Forms
Learn Forms in HTML with practical examples.
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