HTML <input type="password">
Example
Define a password field (characters are masked):
<label for="pwd">Password:</label>
<input type="password" id="pwd" name="pwd">
Try it Yourself »
Definition and Usage
The <input type="password">
defines a password field (characters are masked).
Note: Any forms involving sensitive information like passwords should be served over HTTPS.
Tip: Always add the <label>
tag
for best accessibility practices!
Browser Support
Attribute | |||||
---|---|---|---|---|---|
type="password" | Yes | Yes | Yes | Yes | Yes |
Syntax
<input type="password">