找错误,无法提示信息
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.<html>
<head>
<title> test </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style>
</style>
<script type="text/javascript">
function check()
{
var user=form1.user.value;
var pwd=form1.pwd.value;
if((user=="")||(user=null))
{
alert("请输入用户名");
form1.user.focus();
return;
}
else if((pwd="")||(pwd=null))
{
alert("请输入密码");
form1.pwd.focus();
return;
}
else
form1.submit();
}
</script>
</head>
<body style="overflow:auto;">
<form id="form1" name="form1" >
<table>
<tr>
<td colspan="2" align="center">用户登录</td>
</tr>
<tr>
<td>用户名:</td>
<td><input id="user" name="user"></td>
</tr>
<tr>
<td>密码:</td>
<td><input id="pwd" name="pwd" type="password"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="button" value="登录" onclick="check()">
<input type="reset" value="重置">
</td>
</tr>
</table>
</body>
</html>
为什么我只输入用户名,并输入密码,不会提示我呢??