1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function checkEmail()
{
var email = document.getElementById("email").value;
if(email == "" || email == null) {
document.getElementById("email_helper").innerHTML = "";
return false;
}

var myreg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
if(!myreg.test(email)) {
document.getElementById("email_helper").innerHTML = "请输入正确的邮箱";
} else {
document.getElementById("email_helper").innerHTML = "";
}
}