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实现密码框显示提示文字的更多相关文章
- html里输入框和密码框的提示文字怎么弄
HTML5 新增属性,浏览器版本低于IE8应该不支持 placeholder 属性 placeholder 属性规定用以描述输入字段预期值的提示(样本值或有关格式的简短描述). 该提示会在用户输入值之 ...
- uitextfield 设置为密码框显示
uitextfield 设置为密码框显示: 在xib中,将文本secure的复选框选中即可.
- jquery 实现 <imput>标签 密码框显示/隐藏密码功能
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 < ...
- winform Textbox模糊搜索实现下拉显示+提示文字
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- Jquery 实现密码框的显示与隐藏【转载自http://blog.csdn.net/fengzhishangsky/article/details/11809069】
<html> <head> <script type="text/JavaScript" src="jQuery-1.5.1.min.j ...
- Jquery实现文本框输入提示
一些用户体验好的表单都会在文本框里设置输入提示,文本框获取焦点时,提示内容消息,如果未输入,失去焦点时又会出现提示. 网上找到一个比较好用的控件jquery.inputDefault.js 使用方法: ...
- $.messager.confirm修改弹出框按钮提示文字
$.messager.confirm 默认提示语为“OK”和“Cancel”.引入中文控件后变为“确定”和“取消” <script src="../js/locale/easyui-l ...
- bootstrap3.0 模态框显示的文字超出怎么办
版本:bootstrap3.3 模态框文字超出 解决方案: 在html中控制自动换行 其实只要在表格控制中添加一句<div style="word-break:break-all& ...
- ASP.NET JQuery 随笔-搜索框默认提示
一.文本框中创建默认文本提示 通常用户在搜索内容时,在文本框输入内容前,文本框都会给出默认提示,提示用户输入正确的内容进行搜索. 当文本框获得焦点,如果文本框内容跟提示内容一样,提示内容会自然消失. ...
随机推荐
- asp.net等项目编译失败的原因之不能写入
本人遇到过一次生成mvc4项目失败,说是不能写入,后发现是权限问题,特此记录. 解决方案: 对C盘下的temp文件夹设置当前用户的写入权限即可.
- D - K Smallest Sums(多路归并+贪心)
Problem K K Smallest Sums You're given k arrays, each array has k integers. There are kk ways to pic ...
- SQL中Len与DataLength区别
SQL中求字符串长度问题 一.LEN(Param) 求字符串的长度 DataLength(param) 求字符串所占的字节长度 二.LEN不返回文本之后的空格长度 而DataLenth则不同 三.针对 ...
- 02.Java多线程并发库API使用
1. 传统线程技术回顾 继承线程与实现Runnable的差异?为什么那么多人都采取第二种方式? 因为第二种方式更符合面向对象的思维方式.创建一个线程,线程要运行代码,而运行的代码都封装到 ...
- IE 9渲染overflow的bug及解决
问题: table父级元素div设置overflow:auto, 当触发table中的checkbox,dropdownlist事件控件时,父级div高度会自动增加(在底部增加空白行). 解决方案: ...
- 12. Android框架和工具之 StringUtils(字符串操作)
1. StringUtils介绍: StringUtils是apache commons lang库(http://commons.apache.org/proper/commons-lang/dow ...
- 编译代码报出Android library projects cannot be launched错误的解决
Android library projects cannot be launched错误的解决方法: 右键工程根目录->properties 左侧选择->android
- iOS block简单传值
(1)声明block变量并设置返回值类型 typedef int(^MYBlock)(NSString *); @property (nonatomic, copy) MYBlock block; ( ...
- unity中js脚本与c#脚本互相调用
unity中js脚本与c#脚本互相调用 test1.js function OnGUI() { if(GUI.Button(Rect(25,25,100,30),"JS Call CS& ...
- sql server小技巧-自动添加时间与主键自增长
在敲机房收费系统的时候,遇到添加时间的时候总是通过vb端调用当前时间再添到sql server中,期间还有时因为添加时间格式的不统一导致一些小问题,现在才知道原来是自己孤陋寡闻,sql server ...