<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>email输入验证</title>
<script language="
javascript" type="text/javascript">
function validate(f){
var value=f.email.value;
if(!/^w+@w+.w+$/.test(value)){
alert("Email输入格式输入错误!");
f.email.focus();
f.email.select();
return false;
}
return true;
}
</script>
</head>
<body>
<form action="" method="post" name="myform" onsubmit="return validate(this)">
EMAIL:<input type="text" name="email" />
<input type="submit" value="提交" />
</form>
</body>
</html>