首页 > 其他 > 详细

表单非空校验

时间:2015-09-11 10:35:36      阅读:204      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>非空校验</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<input type="text">
<input type="text">
<input type="text">
<input type="text">
<script type="text/javascript">
$(function(){
$(":text").blur(function(){
if($(this).val().length<=0){
$(this).css("background","red");
}else{
$(this).css("background","white");
}
})
})
</script>
</body>
</html>

表单非空校验

原文:http://www.cnblogs.com/nifengs/p/4800091.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!