為什么點(diǎn)擊取消按鈕和右上角的叉到要加油哦,表示不理解
<!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變量,用來存儲(chǔ)用戶輸入的成績(jī)值。
score=prompt("請(qǐng)對(duì)成績(jī)做出評(píng)價(jià)");
if(score>=90&&score<=100)
{
? document.write("你很棒!");
}
else if(score>=75&&score<90)
? ? {
? document.write("不錯(cuò)吆!");
}
else if(score>=60&&score<75)
? ? {
? document.write("你會(huì)更棒的");
? ? }
? ? else if(score>=0&&score<60)
? ? {
? ? ? ?document.write("要加油哦");
? ? }
? ? else
{
? ? ? ?document.write("你輸入放入數(shù)字有誤,請(qǐng)重新輸入");
}
? }
? </script>
</head>
<body>
? ? <input name="button" type="button" onClick="rec()" value="點(diǎn)擊我,對(duì)成績(jī)做評(píng)價(jià)!" />
</body>
</html>
看一看
2016-11-28
null和“”轉(zhuǎn)換為number類型時(shí)為0
2016-11-28
點(diǎn)擊取消 返回是null,默認(rèn)為0