效验页面邮箱

效果:

代码:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>效验meail</title>
</head>
<body>
<br>
<center>
<form>

邮箱地址:<input name="meail_input_name" type = "text" id="meail_input_id" value="" placeholder="请输入正确的邮箱">
<input name="meail_check_name" type = "button"id="meail_check_id" value="效验邮箱" onclick="checkMeail()">
</form>
</center>
</br>
</body>
<script type="text/javascript">
function checkMeail(){
var meailAddress=document.getElementById("meail_input_id").value;
//长度
var meailLength = meailAddress.length;
//判断含有@,“.”
var index1 = meailAddress.indexOf("@");
var index2 = meailAddress.indexOf(".");
var msg = "效验输入的邮箱号n";
msg = "@所在的索引:==:" index1;
msg = "\\\’.\\\’所在的索引:==:" index2;
msg ="邮箱地址:" meailAddress "n";
msg ="验证邮箱地址的实例:"
if (index1==-1||index2==-1||index1<index2) {
msg ="邮箱的基本要求:" "n";
msg ="必须含有\\\’@\\\’和\\\’.\\\’ n";
msg ="\\\’.\\\’必须在\\\’@\\\’后面n";
}else{
msg = "符合要求";
};
alert(msg);
}

</script>
</html>

更多关于云服务器域名注册虚拟主机的问题,请访问西部数码官网:www.west.cn

赞(0)
声明:本网站发布的内容(图片、视频和文字)以原创、转载和分享网络内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-62778877-8306;邮箱:fanjiao@west.cn。本站原创内容未经允许不得转载,或转载时需注明出处:西部数码知识库 » 效验页面邮箱

登录

找回密码

注册