From the course: HTML Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

HTML form basics

HTML form basics

- Form fields have been an integral part of the web for decades. Forms on the web are how we get things done. We log into sites through forms, we buy things through forms, request a search, add content to a site. These interactions all happen through form elements, or they should happen through semantic form elements and not through divs and spans. By using HTML form elements we tap into the power that's built into the browser. We'll save ourselves a lot of wasted effort trying to recreate in custom JavaScript what's already been built into the browser. We ensure that our forms will work on every device for every possible combination of input and output hardware, including devices we've never heard of. Let's jump in by creating a simple form that people might use to sign up for an email newsletter. We want to collect two fields: their name and their email address. We'll start our form by using the form element. It tells…

Contents