9.2 Input Password

Setting the value of the attribute type to password means that when visitors type characters into a password field, the browser displays asterisks or bullets instead of the actual characters as a measure of security. For example:

<form>
Username: 
<input type="text" name="user">
<br />
Password: 
<input type="password" name="password">
</form>

This would look like this in a browser (try entering some data):

Username:
Password:

Again we have used the name attribute to provide a varaible for the input. And take note that the data in the password field is not encrypted and so is not secure. The password feature should not be used for security purposes because the only security it provides is to stop people reading your password over your shoulder!