Password Input Control in HTML Form

<input type="password"> defines a password input field for text input. It is also a single-line text input but it masks the character as soon as a user enters it. Example :
<!DOCTYPE html>
	  <title>Password Input Control </title>
     <form action="login_page.php" method="post">
	Enter Password :
	<input type="password" name="pass" maxlength="15"/>
	<br />
	<br />
        Confirm Again :
	<input type="password" name="pass_again" maxlength="15"/>
The output of above code will be :

Attributes :

The attributes used in the password input control  are as follows :

  • type : Indicates the type of input control and for password input control it will be set to password.
  • name : Used to give a name to the control which is sent to the server to be recognized and get the value.
  • value : This can be used to provide an initial value inside the control.
  • size : Used to specify the width of the text-input control in terms of characters.
  • maxlength : Used to specify the maximum number of characters a user can enter into the text box.

Next Topic :