示例1:
<body>
<form name="f1" id="f2" action="http://www.baidu.com" method="get" οnsubmit="return check()">
<table>
<tr>
<td>Login</td>
<td><input type="text" name="username" id="username" ></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" id="password" ></td>
</tr>
<tr>
<td colspan="2" ><input type="submit" ></td>
</tr>
</table>
</form>
</body>
<script type="text/javascript">
//提交之前进行检