How to Hide Password in HTML ?
Hiding the password is commonly known as Password Masking. It is hiding the password characters when entered by the users by the use of bullets (•), an asterisk (*), or some other characters.
It is always a good practice to use password masking to ensure security and avoid its misuse. Generally, password masking is helpful to hide the characters from any user when the screen is exposed to being projected so that the password is not publicized.
In this article, we will learn to hide the password using HTML.
Method 1: Using the input type = “password”
<input type="password" placeholder="Enter your Password">
Method 2: Using the input type = “text”
- This method is not very much preferred, in this method we would just be camouflaging the text into some characters of our own choice.
- This method is deprived of security and is recommended only for password masking with other characters such as squares, circles, etc.
For Squares: -webkit-text-security: square
For Circles: -webkit-text-security: circle