9.8. Password Input Boxes

The password input box is similar to the text box, but it visually obscures data entered into the box by displaying asterisks or bullets instead of the actual characters entered into the field. The following example displays a password field that accepts 20 characters.

<p>Password: <input type="password" name="password" id="password" value=""
  size="20" maxlength="20" /></p>

Note that the password field only visibly obscures the data to help stop casual snoops from seeing what a user inputs into a field. It does not encode or in any way obscure the information at the data level. As such, be careful how you use this field.

Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.