62,266
社区成员
发帖
与我相关
我的任务
分享
<asp:TextBox ID="txtLoginPwd1" style="height:28px;width:202px;border:#868690 solid 1px;line-height:28px;" Text=" - 请输入密码" onFocus="ChangeUnameNonePwd();" runat="server" TextMode="SingleLine"></asp:TextBox>
<asp:TextBox ID="txtLoginPwd" style="height:28px;width:202px;border:#868690 solid 1px;line-height:28px;display:none;" onblur="ChangeUnameBlockPwd();" runat="server" TextMode="Password"></asp:TextBox>
//鼠标移上txtLoginPwd1隐藏txtLoginPwd1显示txtLoginPwd,并等到焦点
function ChangeUnameNonePwd() {
var inputname = document.getElementById("<%=txtLoginPwd.ClientID%>");
var inputname1 = document.getElementById("<%=txtLoginPwd1.ClientID%>");
inputname1.style.display = "none";
inputname.style.display = "block";
inputname.focus();
}
function ChangeUnameBlockPwd() {
var inputname = document.getElementById("<%=txtLoginPwd.ClientID%>");
var inputname1 = document.getElementById("<%=txtLoginPwd1.ClientID%>");
inputname.style.display = "none";
inputname1.style.display = "block";
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
.tip{ background-image: url(http://www.guaik.com/i/bg/logo200712.gif)}
</style>
</head>
<body>
<input type="password" class="tip" style="height: 75px; width:200px;" onfocus="this.className='';" onblur="if( this.value == '') this.className='tip';" />
</body>
</html>