var el=$("#reg_email"); el.removeClass('focus'); var name=el.attr("name"); var val=el.val(); var length=val.length; var p=el.parent(); var tipsEl=p.find("em"); tipsEl.attr("class","error").html("

"+registerTip.emailError+"

").attr("class","error"); $("#reg_email").attr({"status":"error","class":"error"});