JQuery 提示用户名密码不为空
2015-12-03 11:06
501 查看
$(document).ready(function(){
//HTML()替换 HTML函数
//append()追加 :input = :text,:password
$(":text,:password").blur(function(){
var v = $(this).val();
$(this).next().remove();
if(v==""){
//$(this).parent().html("用户名不能为空");
var name = $(this).attr("name");
$(this).parent().append("<font color='red'>"+name+"不能为空");
}
});
});
//HTML()替换 HTML函数
//append()追加 :input = :text,:password
$(":text,:password").blur(function(){
var v = $(this).val();
$(this).next().remove();
if(v==""){
//$(this).parent().html("用户名不能为空");
var name = $(this).attr("name");
$(this).parent().append("<font color='red'>"+name+"不能为空");
}
});
});
相关文章推荐
- jQuery 1.9.1源码分析系列(十五)动画处理之缓动动画核心Tween
- jQuery EasyUI使用教程之添加自动播放标签
- 13个jQuery操作table常用到的功能
- jquery时间戳转日期
- 转:jquery获得select option的值 和对select option的操作
- jQuery-1.9.1源码分析系列(十五) 动画处理——缓动动画核心Tween
- jQuery与java之SSH解决跨域请求
- jquery中的replaceWith()和html()有什么区别?
- js 事件冒泡是什么如何用jquery阻止事件冒泡
- jQuery is not must for us--元素选取
- jQuery使用prop设置checkbox全选、反选
- jQuery使用prop设置checkbox全选、反选
- Jquery操作Radio
- 8款超绚丽的jQuery焦点图动画
- jQuery.Validate常用的一些规则
- jQuery.Validate常用的一些规则
- jQuery1.4.2中关于:not(:first)一个问题
- jQuery中的mouseenter和mouseleave事件
- jQuery选择器
- jQuery移动web开发中的页面初始化与加载事件