标签:.com margin png 错误 验证邮箱 display test tle log
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>邮箱正则</title>
</head>
<body>
<input type="text" id="Txt1" />
<input type="button" value="提交" id="btn1" />
<script>
window.onload=function(){
var oTxt=document.getElementById("Txt1");
var oBtn=document.getElementById("btn1");
oBtn.onclick=function(){
var re=/^\w+@[0-9a-z]+\.[a-z]+$/i;
if(re.test(oTxt.value))
{
alert("恭喜你,答案正确");
}
else
{
alert("对不起验证错误");
}
}
}
</script>
</body>
</html>
标签:.com margin png 错误 验证邮箱 display test tle log
原文地址:http://www.cnblogs.com/cxy66/p/6050142.html