怎样在密码表单已经输入的状态下不要弹出confirm对话框
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 鼠标经过事件 </title>
<script type="text/javascript">
function message(){
var pw=document.getElementById("pp").value;
if(pw==""){
confirm("请输入密码后,再单击确定!")
}
else{
alert("成功输入"+pw)
}
}
</script>
</head>
<body>
<form>
密码:<input name="password" type="password" id="pp" >
<input name="确定" type="button" value="确定"
onclick="message()"/>
</form>
</body>
</html>为什么我的判定条件是if(pw==null)的时候,不好用呢??