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 随笔-搜索框默认提示
一.文本框中创建默认文本提示 通常用户在搜索内容时,在文本框输入内容前,文本框都会给出默认提示,提示用户输入正确的内容进行搜索. 当文本框获得焦点,如果文本框内容跟提示内容一样,提示内容会自然消失. ...
随机推荐
- Sum of divisors
Problem Description mmm is learning division, she's so proud of herself that she can figure out the ...
- 1.7.3 Relevance-相关性
1. 相关性 相关性是一个查询响应满足用户搜索信息的一个度(程度). 查询响应的相关性主要依赖于上下文的查询.单个搜索应用程序可以通过用户的不同需求和期望被用来在不同的上下文.例如,气候数据的搜索引擎 ...
- js动态增加表格
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 教您如何检查oracle死锁,决解死锁
oracle死锁问题一直困扰着我们,下面就教您一个oracle死锁的检查方法,如果您之前遇到过oracle死锁方面的问题,不妨一看…… oracle死锁问题一直困扰着我们,下面就教您一个oracle死 ...
- 把当前时间(NSDate)转为字符串 - 获取当前时间的Day
1.把当前时间转为字符串 (NSDate与北京时间相隔8小时,格式化之后就是北京时间) NSDate *date = [NSDate date]; NSDateFormatter *dateForma ...
- javascript事件代理(委托)
之前有接触过事件代理,但是印象并不深刻.这次记下来加强印象. 用个大家比较常见的代码举例子: html dom结构: <ul id="ul1"> <li>0 ...
- Part 3 talking about constraint in sql
What is Foreign key and how to create a Foreign key constraint? Note:Foreign Keys are used to enforc ...
- (转)Android之常用功能方法大集合
这些,都是Andorid中比较常用的方法和功能,在网上搜集整理一下记录之,以备不时之需.由于经过多次转载,源文作者不确凿,在此申明,敬请见谅.不得不赞,非常实用. 1.判断sd卡是否存在 boolea ...
- WPF非UI线程获取修改控件属性值的方法
public class InvokeHelper { #region delegates private delegate object MethodInvoker(Control control, ...
- asp.net中URL参数传值中文乱码的三种解决办法
在做Asp.Net开发的时候,参数传递中文时,经常会遇到页面乱码的问题,下面是在网上收集的相关资料,请大家参考: 解决的方法一般有3种: 1.设置web.config文件 <system.web ...