欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

密碼框顯示提示文字jquery示例

 更新時間:2013年08月29日 18:13:23   作者:  
密碼框提示文字的功能還是比較實用的,下面為大家介紹下使用jquery簡單的實現(xiàn)下,喜歡的朋友可以參考下
復(fù)制代碼 代碼如下:

<html>
<head>
<title>登錄</title>
<script type="text/javascript" src="./jquery-1.3.2.min.js"></script>
<script>
$(document).ready(function(){
$(".text_login").focus(function(){
if($(this).val()=='user name' || $(this).val()=='password'){
$(this).val('');
}
if($(this).attr('id')=='password1'){
$(this).hide();
$('#password2').show();
$('#password2').focus();
}
});
$(".text_login").blur(function(){
if($(this).attr('id')=='password2' && $(this).val()==''){
$(this).hide();
$('#password1').show();
$('#password1').val('password');
}
else if($(this).attr('id')=='uname' && $(this).val()=='' ){
$(this).val('user name');
}
});
});
</script>
</head>

<body>
<table cellpadding="0" cellspacing="0" class="tb_login" border="0">
<tr>
<td> 賬號:</td>
<td>
<input type="text" name="uname" value="user name" id="uname" class="text_login"/>
</td>
</tr>
<tr>
<td> 密碼:</td>
<td>
<input type="text" value="password" id="password1" class="text_login"/>
<input type="password" id="password2" style="display:none;" class="text_login"/>
</td>
</tr>
</table>
</body>
</html>

相關(guān)文章

最新評論