HTML5 Forms
HTML
What is an HTML form?
An HTML form is used to collect user input.
It can collect:
. Text
. Emails
. Passwords
. Choices (radio, checkbox)
. Files And more
A form sends this data to a server (or handles it with JavaScript) to process.
Attribute | Meaning |
---|---|
action | The URL where form data will be sent. |
method | HTTP method (get or post). |
Common Form Elements
Tag | What it does |
---|---|
<input> | Takes various kinds of input (text, email, password, etc). |
<textarea> | For multi-line text. |
<select> | Dropdown list. |
<option> | Options inside <select> |
<button> | Clickable button (submit, reset, etc). |
<label> | Labels an input for accessibility. |