61,112
社区成员
发帖
与我相关
我的任务
分享
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>登陆</title>
</head>
<body>
<table border="0" align="center">
<tr>
<td colspan="2" align="center">用户登陆</td>
</tr>
<tr>
<td>用户名:</td>
<td><input name="username" type="text" id="username" /></td>
</tr>
<tr>
<td>密码:</td>
<td><input name="userpsd" type="password" id="userpwd" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="登陆" /> </td>
</tr>
</table>
</body>
</html>
<script language="javascript">
function check()
{
if((username.value=="zhangsan") &&(userpwd.value=="123"))
//alert("正确");
location.href="1.html";
else
alert("错误");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>登陆</title>
</head>
<script language="javascript">
function check()
{
if((username.value=="zhangsan") &&(userpwd.value=="123"))
alert("正确");
else
alert("错误");
}
</script>
<body>
<table border="0" align="center">
<tr>
<td colspan="2" align="center">用户登陆</td>
</tr>
<tr>
<td>用户名:</td>
<td><input name="username" type="text" id="username"/></td>
</tr>
<tr>
<td>密码:</td>
<td><input name="userpsd" type="password" id="userpwd" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="登陆" onClick="check();"/> </td>
</tr>
</table>
</body>
</html>