亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

這樣的代碼出來沒有按鈕,只有輸入框??

這樣的代碼出來沒有按鈕,只有輸入框??

<!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?sorce; ??sorce=prompt("請輸入你的成績"); ??if?(sorce>=140) ??{document.write("非常棒!");} ??if?else(sorce>=120) ??{document.write("很好");} ??if?else(sorce>=90) ??{document.write("加油哦");} ??else ??{document.write("要努力了啊");} ??} ?</script> ?</head> ?<body> ?<input?name="button"?name="button"?onClick="rec()"?value="點擊我,對成績做評價!"?/> </body> </html>
查看完整描述

2 回答

?
dommon

TA貢獻2條經驗 獲得超0個贊

js也有錯誤 if else 改成 else if

<!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?sorce;
??????sorce=prompt("請輸入你的成績");
??????if?(sorce>=140)
??????{document.write("非常棒!");}
??????else?if(sorce>=120)
??????{document.write("很好");}
??????else?if(sorce>=90)
??????{document.write("加油哦");}
??????else
??????{document.write("要努力了啊");}
??}
?</script>
?</head>
?<body>
?<input?name="button"?type="button"?onClick="rec()"?value="點擊我,對成績做評價!"?/>
</body>
</html>


查看完整回答
反對 回復 2015-10-13
  • 2 回答
  • 0 關注
  • 1276 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號