表单类 文本框失去焦点jquery

表单类失去焦点的效果
<script type="text/javascript">


	$(function(){
		$(":input").focus(function(){	//此处可获取各种表单如(:text/:button)
			$(this).addClass("focusa");	
			if ($(this).val()==this.defaultValue){	
				$(this).val("");
				}
			}).blur(function(){	
			$(this).removeClass("focusa");						
			if ($(this).val()==""){				
				$(this).val(this.defaultValue);								
				}				
				});		
		});
</script>



各种表单的类型:


<input type="text" /> 文本框 
<input type="password" /> 密码框 
<input type="submit" /> 提交按钮 
<input type="reset" /> 重置按钮 
<input type="radio" /> 单选框 
<input type="checkbox" /> 复选框 
<input type="button" /> 普通按钮 
<input type="file" /> 文件选择控件 
<input type="hidden" /> 隐藏框 
<input type="image" /> 图片按钮 


原文地址:https://www.cnblogs.com/javawebsoa/p/3043235.html