JS代码的邮箱匹配

来源:互联网 发布:php 设置北京时区 编辑:程序博客网 时间:2024/05/01 11:40

        先粘贴一个:

<script language="javascript">function check(){var email=document.getElementById("email").value;var isemail=/^\w+([-\.]\w+)*@\w+([\.-]\w+)*\.\w{2,4}$/;if (email=="") {      alert("请输入您的邮箱!");      return false;    }if (email.length>25){     alert("长度太长");     return false}if (!isemail.test(email)){     alert("不是邮箱");    return false;}}</script>


 

原创粉丝点击