是不是这样?
<html>
<head>
<title>无标题</title>
<head>
<body>
<input size=100 [email protected] title="在此输入回车测试你的EMAIL是否正确" onkeypress="if(event.keyCode==13)alert((new RegExp('^[A-Za-z]{1}[a-zA-Z0-9-_]{0,}@[a-zA-Z0-9]{1,}.[a-zA-Z0-9]{1,}','g').test(this.value)))">
</body>
</html>
<html>
<head>
<title>无标题</title>
<head>
<body>
<input size=100 [email protected] title="在此输入回车测试你的EMAIL是否正确" onkeypress="if(event.keyCode==13)alert((new RegExp('^[A-Za-z]{1}[a-zA-Z0-9-_]{0,}@[a-zA-Z0-9]{1,}.[a-zA-Z0-9]{1,}','g').test(this.value)))">
</body>
</html>
function check()
{
if(document.all.email.value.match(/^[\w\-]{1,20}@([\w\-]{1,10}\.)+[a-z]{2,3}$/i)==null)
{
alert("E-mail有误");
document.all.email.focus();
return false;
}
alert("正确");return false;
return true;
}
</script>
<form onsubmit="return check()">
<input type="text" name="email">
<input type="submit">
</form>