<form> Element
Wrap input controls so they can be submitted together.
1Form Basics
The action attribute points to the URL that handles submission, method picks GET (search) or POST (data changes). Browsers send all named controls inside the form.
<form action="/signup" method="post">
<label for="email">Email</label>
<input id="email" name="email" type="email" required />
<button type="submit">Sign up</button>
</form>2Put the element in context
A form groups fields for a submission. Its action and method describe where and how the request is sent, while the controls’ names identify submitted values. A styled form without a working destination can appear successful while losing a visitor’s inquiry.
3Practice with a small page
Create a labeled email field and message field inside a form. Inspect the names and the intended submission destination. Use a safe test endpoint or local example, validate the received data, and check an error state before publishing a real contact form.
Finished reading?
Mark this topic as complete to track progress.