input element for password input

The type='password' creates an input element for entering a password. The characters that the user types are represented by a masking character, such as an asterisk (*).

Additional Attributes Available for the password Type

AttributeDescriptionNew in HTML5
maxlengthmaximum number of characters that user can enter .No
patternregular expression for the validation.Yes
placeholdera hint to the userYes
readonlymakes the password box read-onlyNo
requiredif the user must enter a value for the passwordYes
sizethe width of the element, the number of visible characters in the password box.No
valuethe initial value for the password.No
      <form method="post" action="http://yourServer/form">
                  <label for="name"> Name: <input value="Adam" id="name"
                        name="name" />
                  <label for="password"> Password: <input type="password"
                        placeholder="Min 6 characters" id="password" name="password" />
                  <label for="fave"> Choice: <input value="Apples" id="fave"
                        name="fave" />
            <button type="submit">Submit Vote</button>
Click to view this demo.
  HTML CSS Book 

  1. <input> element
  2. input element max size
  3. input text field size
  4. input text field initial value
  5. input text field placeholders(gray text)
  6. Using a Data List
  7. Read-Only input text field
  8. Disabled Text Boxes
  9. input element for password input
  10. Using the input Element to Create Buttons