当前位置: 移动技术网 > IT编程>开发语言>JavaScript > 显示、隐藏密码

显示、隐藏密码

2019年07月31日  | 移动技术网IT编程  | 我要评论
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta name="generator" content="microsoft frontpage 4.0">
<meta name="progid" content="frontpage.editor.document">
<title>显示、隐藏密码-www.51windows.net</title>
<style>
body,input{font:menu}
</style>
</head>
<body>
<form method="post" action="addcheck.asp" name="forms">
<span id=box><input type="password" name="password" size="20" value="51windows.com"></span>
<span id=click><a href="javascript:ps()">显示密码</a></span>
<script language="javascript">
<!--51windows.com:海娃 23:17 2002-8-17-->
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()\">隐藏密码</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()\">显示密码</a>"}
</script></form>
<script>
function help(){
title="显示、隐藏密码"
time="23:17 2002-8-17"
tips="显示、隐藏input中的密码,动态改为input的type值。在提示注册时就不用来两个输入框了:)"
info="\nwww.51windows.com\n海娃:jimao8@163.com"
alert(title+"\n("+time+")\n\n"+tips+"\n\n"+info)}
document.write("<button style='font:menu;position: absolute; top: 20; right: 10;' onclick=help();>help</button >");
document.write("<button style='font:menu;position: absolute; top: 20; right: 50;' onclick=window.location='view-source:'+window.location.href;>源文件</button >")
</script>
</body>
</html>

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网