An HTML form is basically a container. It contains input fields and sends user-entered data to a server. Think of it like a digital writing board where users fill in details: names, emails, passwords, even that dreaded credit card info.
This is a basic example:

The action attribute tells the browser where to send the data. The method (usually GET or POST) defines how it’s sent.
Inputs: The Data Entry Points
Inside the form, you’ve got input elements. These are the actual fields users interact with—textboxes, checkboxes, radio buttons, date pickers, and so on.
Here’s a simple text input:

The name attribute is crucial; it secretly labels the data, allowing the server to identify it.
Labels: The Invisible Glue
Labels also play a significant role. Without clear labeling, a simple input field would leave users confused about its purpose.
But it does more than that. When a label is associated properly with an input, clicking the label brings focus to the field. It’s a subtle but important accessibility feature.

The for attribute on the label matches the id on the input. That’s how the browser links the two.

You can also wrap the input inside the label tag—this works too:

Placeholders
If you need to give users more guidance on the input format, use the placeholder attribute. Here is an example using the placeholder attribute inside the email input:

Placeholder text should be short and helpful, illustrating the desired data format and type for users.
In this case, the placeholder text, example@email.com, shows the user that they must enter a correctly formatted email address.
Putting It All Together
Here’s what a full, simple form might look like:
