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

Password Input

When you type a password, you usually don't see the text you typed, only dots. That's so that nobody looking at your screen can read it.

An input like this is created by the input element with the attribute type="password":

<label for="input-pin">PIN</label>
<input type="password" name="pin" id="input-pin">

This code is displayed like this (try typing into it):

We use this input wherever users enter something secret.

So that each label and its input are on their own line, we put them into a div. A div always starts on a new line. In the editor, we've already wrapped the name in a div and prepared an empty div for the password.

Instructions

  1. 1

    In the empty div, create an input element with the attribute type with the value password.

  2. 2

    Add the attribute name with the value password and the attribute id with the value input-password to this input.

  3. 3

    Before the input, create a label with the content Password and the attribute for with the value input-password.

Back

4/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.