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> 

最新文章

  1. 2-ser2003系统封装实验报告
  2. 【菜鸟学习jquery源码】数据缓存与data()
  3. 数据结构作业——sights(最短路/最近公共祖先)
  4. iOS 自定义滑动切换TabBar
  5. ionic icons and splash
  6. 建立树莓派raspberry交叉编译环境以及编译内核
  7. jQuery Lazy Load 图片延迟加载
  8. hdu1251(Trie树)
  9. CentOS6.5查看一port执行状态
  10. .28-浅析webpack源码之compiler.resolvers
  11. fiddler修改Requests之前的数据和response 之后的数据
  12. Redis基础用法、高级特性与性能调优以及缓存穿透等分析
  13. Java核心技术卷一基础知识-第6章-接口与内部类-读书笔记
  14. Zookeeper 3.5启动时 8080端口被占用
  15. mysql之my.cnf详解
  16. Chap1:全景图[Computer Science Illuminated]
  17. [日常] nginx与HTTP cache
  18. mysql 免安装版
  19. Java Log Viewer日志查看器
  20. iOS-高仿通讯录之商品索引排序搜索

热门文章

  1. EF——继承映射关系TPH、TPT和TPC的讲解以及一些具体的例子 05 (转)
  2. 1.4.2 solr字段类型--(1.4.2.3)使用货币和汇率
  3. Android学习笔记⑦——UI组件的学习AdapterView相关1
  4. iframe跨域自适应高度
  5. nginx 代理服务器 502错误
  6. 【Trie】模板(动态指针,静态数组)
  7. hdu 4099 Revenge of Fibonacci 大数+压位+trie
  8. 实例--post请求,完成一个抽奖程序概率的测试
  9. 一步步搭建自己的轻量级MVCphp框架-(二)一个国产轻量级框架Amysql源码分析(1)
  10. 数据校验validator 与 DWZ