密码框显示提示文字
2013-08-29 20:24
323 查看
<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>
相关文章推荐
- 密码框显示提示文字jquery示例
- 基于JS实现密码框(password)中显示文字提示功能代码
- jquery实现密码框显示提示文字
- 密码框显示提示文字
- 密码框显示提示文字jquery示例
- 密码框显示提示文字
- extjs完美实现“密码框显示提示文字,不显示输入文字”的变态需求!!!
- js修改input的type属性问题(兼容所有浏览器,主要用于密码类的默认有提示文字的效果)
- 密码框显示placeholder提示信息 onfocus="this.type='password'"
- Android Gallery图片显示和文字提示及Menu 菜单
- android EditText 中显示Error提示的时候文字不见了
- 网页无法显示img标签alt属性给的提示文字!
- js与jquery实现搜索框提示文字显示与隐藏
- Win7/Win8系统如何取消任务栏预览效果只显示窗口名称文字提示
- textarea提示文字换行显示
- 密码框显示提示信息
- 页面显示部分文字,title再显示一个提示
- 关于placeholder.js在IE78密码文本的提示文字调整
- EditText 使用细节(输入内容改变时的监听事件、透明背景、修改提示文字颜色、输入内容密文显示)
- 密码输入框无内容时候显示提示字,有内容则为password