标签:
检测邮箱输入代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>检查是否是邮箱</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
</head>
<body>
<form>
<label>邮箱:</label><input type="text" onkeyup="email(this)">
</form>
<script>
function email (argument) {
var aa=argument.value;
var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
if(!myreg.test(aa)){
alert("邮箱输入不合法");
}
// body...
}
</script>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/jackzzx/p/4658848.html