null 和undefined和非的区别
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> 鼠标经过事件 </title>
<script type="text/javascript">
function message(){
var info=document.getElementById("psw").value;
if(!info){
confirm("请输入密码后,再单击确定!");
}
else{ confirm("yes"); }
}
</script>
</head>
<body>
<form>
密码:<input name="password" type="password" id="psw" >
<input name="确定" type="button" value="确定" onmouseover="message()"/>
</form>
</body>
</html>为什么我在if(!info)和if(info=="undefined")和if(info==null) 出来结果不一致。