HTML input: password
allowing the user to write text without anyone else looking
Essentials
The <input>
field for type="password"
can look something like this:
It essentially looks like an <input>
field with the type="text",
except that the user only sees dots (or some kind of cryptic character) instead of the text!
Takeaways
The
id
for atype="password"
field corresponds with the<label>
'sfor
attributeThe
name
can differ from theid
Options
The
minlength
andmaxlength
(an integer) restrict the length of user inputWe can use none, one or both of those attributes
The
placeholder
offers a hint that will disappear on user input (and reappear if reset)
Last updated