//布局
<table border="1px solid black">
<tr style="width: 500px;height:70px;">
<td style="background-color: aqua">请填写您的Email地址:</td>
<td>
<input id="email" type="text" style="background-color: aquamarine"/>
<span id="ee"></span>
<span id="elb">请填写有效的Email地址,在下一步您将用此邮箱接收验证邮件。</span>
</td>
</tr>
</table>
//jquery代码块
var start = false;
$("#email").focus(function(){
if(start==false)
{
$("#elb").text("");
}
});
$("#email").blur(function(){
var email = jQuery("#email").val();
var myreg = /^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
if(myreg.test(email))
{
$("#ee").html("<img src='bbb.gif' style='width: 20px;height:20px;'/>");
$("#elb").text("输入正确!");
start = true;
return auto = 0;
}else
if(email == ""){
$("#elb").text("邮箱不能为空!");
return auto = 1;
}else if(!myreg.test(email)){
$("#ee").html("<img src='aaa.gif' style='width: 20px;height:20px;'/>");
$("#elb").text("请输入有效的邮箱地址!");
return auto = 1;
}else if(checkEmailIsExist()){
$("#elb").text("该邮箱地址已经被注册!");
return auto = 1;
}
});