這里的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= prompt("這次考試多少分?","請輸入數字"); //score變量,用來存儲用戶輸入的成績值。
if(score>=90)
{
? ?document.write("你很棒!");
}
else if(score>=75)
? ? {
? ?document.write("不錯吆!");
}
else if(score>=60)
? ? {
? ?document.write("要加油!");
? ? }
?else if(score=null)
? ? {
? ?document.write("你沒有輸入成績");
? ? }
? ? else
{
? ? ? ?document.write("要努力了!");
}
? }
? </script>
</head>
<body>
? ? <input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!" />
</body>
</html>
2021-03-07
一個等于號是賦值,兩個等于號是判斷是否相等
2021-01-20
看別人問題明白了 要寫兩個等于號...