name → Gives the input a key, so when submitted, the server knows which field the data belongs to.
value → Default or pre-filled value.
placeholder → Grey text hint inside the field.
required → Makes input mandatory.
readonly → Field can’t be edited but can be copied.
disabled → Field is inactive and not sent with the form.
maxlength → Limits the number of characters.
How Data is Sent
When you put <input> inside a <form>, and hit submit:
- The browser collects all inputs with a "name".
- Creates a data package like:
username=John&password=1234
- Sends it to the server (to the URL in the form’s "action").