使用JavaScript编写一个用于验证电子邮件地址是否正确的函数checkForm ()。要求:
(1)E-mail地址不能为空,并且必须包含“@”和“.”。
(2)密码也不能为空,而且其长度必须是6位以上(包括6位)
Html 页面内容如下:
<BODY>
<DIV align="center"> <IMG src="images/Snap2.jpg"></DIV>
<FORM name="myform" action="success.html" method="post" onSubmit="return checkForm()">
<TABLE cellSpacing="0" cellPadding="0" width="670" align="center" border="0">
<TBODY><TR><TD height="30"><IMG src="images/Snap4.jpg"></TD></TR>
<TR><TD bgColor="#d8d8ed"><TABLE cellSpacing="5" cellPadding="0" width="100%" border="0">
<TBODY><TR><TD align="right" width="190"><STRONG>E-mail:</STRONG></TD><TD><INPUT maxLength="100" size="20" name="email"> 请填写有效的E-mail地址作为下次登录的用户名<BR></TD></TR>
<TR><TD align="right" width="190"><STRONG>密码:</STRONG></TD>
<TD><INPUT type="password" size="20" value="" name="pass"> 不少于6个字符,不区分大小写<BR></TD></TR>
<TR><TD style="padding-left:100px">
<INPUT id="btn" type="submit" class="btnPic" name="btn" value=""></TD> </TR>
</TBODY></TABLE></TD></TR></TBODY></TABLE>
</FORM><DIV align="center"><IMG src="images/Snap3.jpg"></DIV></BODY>
</HTML>
: