<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function check()
{var email=document.myform.txt1.value;
if(email.length==0)
{
alert("邮箱不能为空!!");
return;
}
if(email.indexOf("@",0)==-1 || email.indexOf(".",0)==-1)
{
alert("邮箱必须包含@或者.");
return;
}
alert("注册成功!");
}
</script>
</head>
<body>
<form name="myform" action="" method="post">
<p>您的电子邮件
<input type="text" name="txt1"/>*必黔<br />
<input type="button" value="注 册" name="btn" onclick="check()"/>
</p>
</form>
</body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function check()
{var email=document.myform.txt1.value;
if(email.length==0)
{
alert("邮箱不能为空!!");
return;
}
if(email.indexOf("@",0)==-1 || email.indexOf(".",0)==-1)
{
alert("邮箱必须包含@或者.");
return;
}
alert("注册成功!");
}
</script>
</head>
<body>
<form name="myform" action="" method="post">
<p>您的电子邮件
<input type="text" name="txt1"/>*必黔<br />
<input type="button" value="注 册" name="btn" onclick="check()"/>
</p>
</form>
</body>
</html>