为什么null时没有返回结果?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>prompt</title>
<script type="text/javascript">
function rec(){
var score; //score变量,用来存储用户输入的成绩值。
score = prompt("请输入您的成绩:","这里输入0-100以内的数字哦!");
if(score>=90)
{
document.write("你很棒!");
}
else if(score>=75)
{
document.write("不错吆!");
}
else if(score>=60)
{
document.write("要加油!");
}
else if(score<=59)
{
document.write("要努力了!");
}
else if(score==null)
{
document.write("您没有输入成绩!请重新输入!");
}
}
</script>
</head>
<body>
<input name="button" type="button" onClick="rec()" value="点击我,对成绩做评价!" />
</body>
</html>如果等于null返回没有填写数字为什么不起作用呢?不管点取消还是确定都是要努力了!