The <input> tag with a
type="password" attribute creates a text field where users can securily enter a password.
As characters are entered, they are replaced by a dot ("•") or asterisk ("*") symbol, depending on the browser.
An <input> element of type password.
Characters entered in the password field are replaced by another symbol.
<form action="/tutorial/action.html"> <label for="fullname">Username</label><br /> <input type="text" id="username" name="username"><br /> <label for="password">Password</label><br /> <input type="password" id="password" name="password"><br /> <input type="submit" value="Login"> </form>
Note: For security reasons do not submit password fields with the GET method (like the example above). Always use POST.
<input type="password"> creates an input field for passwords.
Values entered are treated securely; they are masked and restricted in their use, for example, cannot copy.
The password masking character depends on the browser. It can be asterisk, dot, circle, and others.
Here is when
type="password" support started for each browser:
Back to <input>