Information about cookies on this page

Our website uses cookies to ensure the functionality of the website, to collect and analyze information about the performance and usage of the website. Privacy Policy

  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in
  
  • Courses
    • Discord
    • Twitter
    • Linkedin
    • Facebook
    • Instagram
  • Pricing
  • English
  • Čeština
  • Deutsch
  • Русский
Sign inStart free
  • Courses
  • Pricing

Community

Sign in

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. 1

    In the empty div, create an input of type email with the attribute name with the value email and the attribute id with the value input-email.

  2. 2

    Before the input, create a label with the content Email and the attribute for with the value input-email.

Back

5/11

  1. 1. The Form Element
  2. 2. Text Input
  3. 3. Input Label
  4. 4. Password Input
  5. 5. More Input Types
  6. 6. Radio Buttons and Checkboxes
  7. 7. Drop-down List
  8. 8. Longer Text
  9. 9. Form Submission
  10. 10. Required Input
  11. 11. Form Summary
Next

Try it yourself

Do this exercise right here in your browser. No account needed.