Welcome to building HTML forms! Forms are how websites collect information from users—like login pages, contact forms, and surveys.
Every time you fill out information online, you're using an HTML form.
Engagement Message
What's one example of a form you've filled out recently on a website?
The <form>
tag is the container that wraps all form elements. It tells the browser "this is where users can input data."
<form>
acts like a basket—it holds all your input fields together in one organized collection.
Engagement Message
Why do you think all form elements need to be inside a <form>
tag?
The <input>
tag creates fields where users can type information. It's self-closing, just like the <img>
tag.
This creates a simple text box where users can type anything.
Engagement Message
What do you think the type
attribute controls?
Every input needs a name
attribute to identify the data. This is like labeling boxes—it tells the server what information each field contains.
For example:
