HTML Forms

Collect user input with form elements: text fields, buttons, dropdowns, and more.

Step 1 of 6

Forms let users send information

Every time you type into a search bar, log into an account, fill out a survey, or post a comment, you are using an HTML form. Forms exist because the web is not just for reading — it is for interacting. The <form> element is a container that groups input fields together and (when connected to a server) can send the collected data somewhere.

Inside a form, the <input> element creates fields where users type or select things. The <label> element gives each input a visible, clickable label. And <button> lets users submit the form. Even without a backend server, understanding forms is essential — they are the building blocks of every login page, checkout flow, and search bar on the web.

Think of it this way: A form is like a paper questionnaire. The <form> tag is the sheet of paper itself. Each <input> is a blank line or checkbox. Each <label> is the question text next to the blank. And the <button> is the 'Submit' action at the bottom. Without labels, users would stare at blank lines with no idea what to fill in.
Labels are essential

The <label> element is not optional decoration — it is essential for accessibility. Screen readers read the label aloud when a user focuses an input. Clicking the label also focuses the associated input, making forms easier to use on small screens. Connect them with the for attribute matching the input's id.

HTMLREAD ONLY
TAG VIEW

Start typing to see your tags visualized here...

PREVIEW