<html>
<head>
<script>
function verifyAddress(obj)
{
var email = obj.email.value;
var pattern = /^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
flag = pattern.test(email);
if(flag)
{
alert("恭喜您!您填写的邮箱地址是正确的!");
return true;
}
else
{
alert("你填写的邮件错误");
}
}
</script>
</head>
<body>
<form onSubmit="return verifyAddress(this);">
<input name="email" type="text">
<input type="submit" value="提交">
</form>
</body>
</html>
原文地址:http://www.cnblogs.com/bluewelkin/p/3848846.html