<html><head><title>检查邮件地址的有效性</title>
    <script language="JavaScript">
    <!--
    function chk_Email(eform){
        var regex = /^(([\-\w]+)\.?)+@(([\-\w]+)\.?)+\.[a-zA-Z]{2,4}$/;
        if(regex.test(eform.user_email.value)){
            alert("邮件地址有效。")
            return true;
        }
        else{
           alert("邮件地址无效!!!");
           return false;
        }
    }
    // -->
    </script>
    </head>
    <hr>
    <body>
    <h2> 检查邮件地址的有效性 </h2>
    <form name="myForm">
    <p>
    请输入邮件地址: <BR>
    <input type="text" size=40 name="user_email">
    <p>
    <input type="button" value="检测邮件地址" onClick="chk_Email(this.form);">
    </form>
 <hr>
    </body></html>