<input type="password" value="******">这个搞成假的,每次onkeydown事件向隐藏域输入东西
<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>New Page 1</title>
<script language="javascript">
function $Down(me,aim)
{
var obj=document.getElementById(aim);
if(event.keyCode!=13)
{
event.returnValue=0
obj.value+=String.fromCharCode(event.keyCode);
}
}
</script>
</head>
<body>
<input type="text" value="123456" onkeypress="$Down(this,'pass')" />
<input type="hidden" value="" id="pass" />
</body>
</html>
<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>New Page 1</title>
<script language="javascript">
function $Down(me,aim)
{
var obj=document.getElementById(aim);
if(event.keyCode!=13)
{
event.returnValue=0
obj.value+=String.fromCharCode(event.keyCode);
}
}
</script>
</head>
<body>
<input type="text" value="123456" onkeypress="$Down(this,'pass')" />
<input type="hidden" value="" id="pass" />
</body>
</html>
删除可以删除,但是看不到,因为需求是定长的。这个需求本来就不是很合理,所以程序也是很不友好。
查看源文件你也看不到,因为不是密码保存在页面上,是为了临时储存密码作为临时容器,所以是必须的。