Adding a Password in Input Field

A password field is like a text field, the difference being that this control hides each typed character by displaying an asterisk (*) or bullets (.) instead of the character itself. The <input type=”password”> tag in used to add a password field on a Web page.

Let’s do the following steps to add a password field:


<!DOCTYPE html>
<html>
<head>
    <title> Adding Password Field</title>
</head>
<body>
    <h4> Enter username and password</h4>
    <form action=””>
        Username:
        <input type=”text” size=”30”/></br></br>
        Password:
<input type=”password” size=”30” />
<p> <b>Note:</b> The browser displays asterisk or bullets instead of characters in the password field.</p>
    </form>
</body>
</html> 

Save the document with the name AddingPasswordField.html and open on browser.