课程: HTML Essential Training (2020)

今天就学习课程吧!

今天就开通帐号,24,600 门业界名师课程任您挑!

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…

内容