哪有問題嗎?
<!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("請輸入你的成績");? ? ? ? ? ? ?
if(score>=90&&score<=100)
{
? ?document.write("你很棒!");
}
else if(score>=75)
? ? {
? ?document.write("不錯吆!");
}
else if(score>=60)
? ? {
? ?document.write("要加油!");
? ? }
? ? else if(score>=0)
{
? ? ? ?document.write("要努力了!");
}
else
{
? ? document.write("請輸入正確的成績");
}
? }
? </script>
</head>
<body>
? ? <input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!" />
</body>
</html>
為什么點擊“點擊我,對成績做評價”按鈕沒有出現對話框呢,有大佬可以解答嗎
2018-05-04
最后分號的中英文切換,有幾個是中文狀態,改過來就好了