<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</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>
<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>
</html>