-
JS显示隐藏密码
网络 2014/5/6 15:22:01<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script language="JavaScript">
function showps(){
if (this.forms.password.type="password") {
document.getElementById("box").innerHTML="<input type=\"text\" name=\"password\" size=\"80\" style='width:\"150\";' value="+this.forms.password.value+">";
document.getElementById("click").innerHTML="<a href=\"javascript:hideps()\">隐藏密码</a>";
}
}
function hideps(){
if (this.forms.password.type="text") {
document.getElementById("box").innerHTML="<input type=\"password\" name=\"password\" size=\"80\" style='width:\"150\";' value="+this.forms.password.value+">";
document.getElementById("click").innerHTML="<a href=\"javascript:showps()\">显示密码</a>";
}
}
</script>
</head>
<body>
<form method="POST" action="" name="forms">
<span id=box><input type="password" name="password" size="80" style="width:150;" value="sina.com"></span>
<span id=click><a href="javascript:showps()">显示密码</a></span>
</form>
</body>
</html>阅读(668) 分享(0)
上一篇: WiFi流量劫持—— 截获支付宝账号
下一篇: 传统路由器密码泄露漏洞及DNS劫持 无线蹭网安全检测