More Input Types
We already know the types text and password. The type attribute has many more values, and the browser adapts the input to each of them. Here are a few of them and how they look:
type="email"for an email address. On phones, the keyboard shows the @ sign, and when the form is sent, the browser checks that the text looks like an email address.type="number"for numbers.type="date"for a date, which the user can pick from a calendar.type="range"for choosing a value from a range with a slider.
In the next exercises, we'll look at radio buttons, checkboxes, drop-down lists and longer text.
Now let's add an email address to our form. Every input needs a label, so don't forget it.
Instructions
- 1
In the empty
div, create an input of typeemailwith the attributenamewith the valueemailand the attributeidwith the valueinput-email. - 2
Before the input, create a
labelwith the contentEmailand the attributeforwith the valueinput-email.