0Pricing
HTML for Kids · Lesson

Forms: Collecting User Input

Build simple forms with text boxes, buttons, and more.

Forms: Collecting User Input is a free HTML for Kids lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the HTML for Kids learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

1

Forms: Collecting User Input

Welcome to the next lesson! Today, we’ll learn how to create forms in HTML. Forms allow users to input data, such as their name or email address, on your web page.

Forms: Collecting User Input — illustration 1

2

What Are Forms?

Forms are used to collect information from users. For example, when you sign up for an account, you fill out a form with fields like your name and email address.

Forms in HTML are created using the <form> tag.

3

Creating a Basic Form

A form is created using the <form> tag. Inside this tag, you add input fields, buttons, and more.

Example:

<form>
  <label for="name">Name:</label>
  <input type="text" id="name" name="name" />
  <br />
  <label for="email">Email:</label>
  <input type="email" id="email" name="email" />
  <br />
  <button type="submit">Submit</button>
</form>

4

Form Input Types

HTML forms support different types of input fields. Here are some common ones:

  • text: For short text input
  • email: For email addresses
  • password: For passwords
  • number: For numbers

Example:

<form>
  <label for="password">Password:</label>
  <input type="password" id="password" name="password" />
  <br />
  <label for="age">Age:</label>
  <input type="number" id="age" name="age" />
</form>

5

Adding Radio Buttons and Checkboxes

You can use radio buttons for single-choice options and checkboxes for multiple-choice options.

Example:

<form>
  <p>Favorite Color:</p>
  <input type="radio" id="red" name="color" value="red" />
  <label for="red">Red</label>
  <br />
  <input type="radio" id="blue" name="color" value="blue" />
  <label for="blue">Blue</label>
  <br />

  <p>Hobbies:</p>
  <input type="checkbox" id="reading" name="hobby" value="reading" />
  <label for="reading">Reading</label>
  <br />
  <input type="checkbox" id="sports" name="hobby" value="sports" />
  <label for="sports">Sports</label>
</form>

6

Adding Dropdown Menus

You can use the <select> tag to create dropdown menus for users to choose from a list of options.

Example:

<form>
  <label for="country">Select your country:</label>
  <select id="country" name="country">
    <option value="usa">United States</option>
    <option value="uk">United Kingdom</option>
    <option value="canada">Canada</option>
  </select>
</form>

7

Form Buttons

Buttons allow users to submit or reset the form. The <button> tag is commonly used.

Example:

<form>
  <button type="submit">Submit</button>
  <button type="reset">Reset</button>
</form>

8

Styling Your Form

You can style your form using CSS to make it look more attractive. For example, you can adjust the size of fields or change their colors.

Example:

<style>
  form {
    width: 300px;
    margin: 20px auto;
  }
  input, select, button {
    width: 100%;
    padding: 10px;
    margin: 5px 0;
  }
</style>

<form>
  <label for="username">Username:</label>
  <input type="text" id="username" name="username" />
  <button type="submit">Submit</button>
</form>

9

11

Great Job!

Congratulations! You’ve learned how to create forms, use different input types, and style them. Forms are essential for collecting user data and making your web pages interactive. In the next lesson, we’ll explore how to use multimedia, such as videos and audio, to make your pages more dynamic. Get ready for more creativity!

Forms: Collecting User Input — illustration 10

Frequently asked questions

Is the “Forms: Collecting User Input” lesson free?

Yes — the full text of “Forms: Collecting User Input” is free to read here on the web, and the HTML for Kids course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the HTML for Kids course, upgrade to CoddyKit PRO.

What will I learn in “Forms: Collecting User Input”?

Build simple forms with text boxes, buttons, and more. You practise HTML for Kids with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start HTML for Kids?

No prior experience is required. HTML for Kids on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Forms: Collecting User Input” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this HTML for Kids lesson?

Yes. Every HTML for Kids lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Tables: Organizing Data
  2. Forms: Collecting User Input
  3. HTML Attributes
  4. Multimedia: Adding Videos and Audio
← Back to HTML for Kids