HTML <input type=”password”>
HTML <input type=”password”> is used to specify the password field of the input tag. Password should be served over the HTTPS pages because it includes the sensitive information of the user.
Syntax:
<input type="password">
Example:
Here is the basic implementation of HTML <input type=”password”>. Here password input field where characters are masked, enhances security by hiding sensitive information like passwords from plain view.
HTML
<!DOCTYPE html> < html > < head > < title >HTML input type="password"</ title > </ head > < body > < h3 >HTML input type="password" Example</ h3 > < form action = "/action_page.php" method = "post" > < label for = "email" >Email:</ label > < input type = "email" name = "email" placeholder = "Email Address" required pattern = "[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$" > < br > < br > < label for = "paswword" >Password:</ label > < input type = "password" name = "password" placeholder = "Password" required> < br > < br > < input type = "submit" value = "Login" > </ form > </ body > </ html > |
Output: In the above example we create an input field for email and password. The email field includes the format validation and the submit button allows form submission.
HTML input type=”paswword” Related Questions
This can be done by using the <input> tag with type attribute which is set to the value “password“.
Hiding the password is commonly known as Password Masking. It is always a good practice to use password masking to ensure security and avoid misuse.
Contact Us