<input type="password">
<input> elements of type password provide a way for the user to securely enter a password.
The element is presented as a one-line plain text editor control in which the text is obscured so that it cannot be read, usually by replacing each character with a symbol such as the asterisk ("*") or a dot ("•"). This character will vary depending on the user agent and operating system.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
| 1 | 12 | 1 | 1 | 18 | 1 | |
html.elements.input.type_password.insecure_login_handling Non-standard Special handling of password inputs in insecure login pages | | | 52 | | | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
HTML
<label for="pw">Password:</label>
<input type="password" id="pw" name="password"
minlength="8" required
autocomplete="current-password"> Live demo
Use cases
-
Using <input type="password">
<input> elements of type password provide a way for the user to securely enter a password.
Cautions
- May not be supported in older browsers.
Accessibility
- Verify how this element is announced by screen readers.