jquery实现密码框提示文字的功能。
代码:  
 1 <html>
 <head>   3 <title>登录-jquery实现密码框显示文字-www.jbxue.com</title>   4 <script type="text/javascript" src="./jquery-1.3.2.min.js"></script>   5 <script>   6 $(document).ready(function(){   7 $(".text_login").focus(function(){   8 if($(this).val()=='user name' || $(this).val()=='password'){   9 $(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实现密码框显示提示文字的更多相关文章

  1. html里输入框和密码框的提示文字怎么弄

    HTML5 新增属性,浏览器版本低于IE8应该不支持 placeholder 属性 placeholder 属性规定用以描述输入字段预期值的提示(样本值或有关格式的简短描述). 该提示会在用户输入值之 ...

  2. uitextfield 设置为密码框显示

    uitextfield 设置为密码框显示: 在xib中,将文本secure的复选框选中即可.

  3. jquery 实现 <imput>标签 密码框显示/隐藏密码功能

    1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 < ...

  4. winform Textbox模糊搜索实现下拉显示+提示文字

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  5. Jquery 实现密码框的显示与隐藏【转载自http://blog.csdn.net/fengzhishangsky/article/details/11809069】

    <html> <head>  <script type="text/JavaScript"  src="jQuery-1.5.1.min.j ...

  6. Jquery实现文本框输入提示

    一些用户体验好的表单都会在文本框里设置输入提示,文本框获取焦点时,提示内容消息,如果未输入,失去焦点时又会出现提示. 网上找到一个比较好用的控件jquery.inputDefault.js 使用方法: ...

  7. $.messager.confirm修改弹出框按钮提示文字

    $.messager.confirm 默认提示语为“OK”和“Cancel”.引入中文控件后变为“确定”和“取消” <script src="../js/locale/easyui-l ...

  8. bootstrap3.0 模态框显示的文字超出怎么办

    版本:bootstrap3.3 模态框文字超出 解决方案: 在html中控制自动换行   其实只要在表格控制中添加一句<div style="word-break:break-all& ...

  9. ASP.NET JQuery 随笔-搜索框默认提示

    一.文本框中创建默认文本提示 通常用户在搜索内容时,在文本框输入内容前,文本框都会给出默认提示,提示用户输入正确的内容进行搜索. 当文本框获得焦点,如果文本框内容跟提示内容一样,提示内容会自然消失. ...

随机推荐

  1. find the nth digit

    Problem Description 假设:S1 = 1S2 = 12S3 = 123S4 = 1234.........S9 = 123456789S10 = 1234567891S11 = 12 ...

  2. solr4.x配置IK2012FF智能分词+同义词配置

    本文配置环境:solr4.6+ IK2012ff +tomcat7 在Solr4.0发布以后,官方取消了BaseTokenizerFactory接口,而直接使用Lucene Analyzer标准接口T ...

  3. dispatch_group_async可以实现监听一组任务是否完成,完成后得到通知执行其他的操作。这个方法很有用,比如你执行三个下载任务,当三个任务都下载完成后你才通知界面说完成的了

    dispatch_queue_t queue=dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, ); dispatch_group_ ...

  4. seajs第二节,seajs各模块依赖关系

    index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> &l ...

  5. jQuery两个列表中元素相互交换Demo

    效果如图: <html> <head> <meta http-equiv="Content-Type" content="text/html ...

  6. codeforces 680A A. Bear and Five Cards(水题)

    题目链接: A. Bear and Five Cards //#include <bits/stdc++.h> #include <vector> #include <i ...

  7. 查看centos中的用户和用户组

    用户列表文件:/etc/passwd 用户组列表文件:/etc/group 查看系统中有哪些用户:cut -d : -f 1 /etc/passwd查看可以登录系统的用户:cat /etc/passw ...

  8. Android渠道汇总

    序号 渠道名  渠道说明 特殊渠道   1 googleplay  google市场 2 umeng  自动更新 3 office_web  官方网络 4 office_qrcode 官方二维码 硬件 ...

  9. Web 网页常见问题集锦

    1.如何去掉Chrome记住密码后自动填充表单的黄色背景 不知道大家有没有这样的烦恼,在Chrome浏览器中,记住密码后重新填写表单数据时,自动会有黄色背景的出现.(如图a) 图a 而出现这个黄色背景 ...

  10. bind() to 0.0.0.0:80 failed (98: Address already in use)

    You can kill it using: sudo fuser -k 80/tcp And then try restarting nginx again: service nginx start