Introduction to the Lesson

On today's thrilling exploration, we're venturing deep into the realm of HTML forms, structures that capture user data and enable web pages to engage with users. Along this journey, we're also going to familiarize ourselves with a variety of form inputs and learn about data storage using JavaScript. Are you excited yet? Let's dive in!

HTML Forms - An Overview

Before we progress further, let's dissect the anatomy of a typical HTML form. A form contains a series of different elements enclosed between <form> tags.

While the <form> tag marks the beginning and end of a form, the real data collection happens through the use of different form elements within these tags.

HTML forms, the bedrock of the web, contain marked sections on a web page with interactive elements such as text fields and checkboxes. These elements collect user data. We declare an HTML form using the <form> tag.

Here's what a simple form looks like:

You can see that this form is designed to collect both the first and last names of the user.

Form Elements and Input Types

Central to HTML forms is the versatile <input> element. Based on the type attribute, the element's appearance and function vary.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal