javasript realizes password hiding and display

  • 2020-06-12 08:24:15
  • OfStack

javascript to view the hidden password box in the clear text method, user input password display asterisk, how to view the clear text information, js can be used to view the clear text password box.

Enter the password in the password box. The password is displayed with an asterisk. The text is automatically hidden.

User input password display asterisk, how to view the plaintext information, js can be used to view the plaintext password box.

Code:


<html><head><title> Password hiding and display </title>
</head>
<body bgcolor=#fef4d9><br><br>
<center> Password hiding and display </center><br>
<center>
<table bordercolor=#cc0000 border=5 borderlight="green">
<tbody>
<tr>
<td align=middle><div align="center"> Results show that </div></td>
</tr>
<tr>
<td align=middle>
<form name=forms action="" method=post><span id=box>
<input type=password value=523654 name=password></span> <span id=click><a href="javascript:ps()"> Show the password </a></span>
<script language=javascript>
function ps(){
if (this.forms.password.type="password")
box.innerhtml="<input type="html" name="password" size="20" value="+this.forms.password.value+">";
click.innerhtml="<a href="javascript:txt()"> Hidden password </a>"}
function txt(){
if (this.forms.password.type="text")
box.innerhtml="<input type="password" name="password" size="20" value="+this.forms.password.value+">";
click.innerhtml="<a href="javascript:ps()"> Show the password </a>"}
</script>
</form></td></tr></tbody></table></center>
</body>
</html>

The above is the full content of this article, have the need of partners can refer to below.


Related articles: