為什么這樣寫消息對話框出不來了?
<!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
{
? ? ? ?document.write("要努力了!");
}
? }
? </script>
</head>
<body>
? ? <input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!" />
</body>
</html>
為什么這樣寫消息對話框出不來了,直接就提示我"要努力了!"?
2015-08-01
這里缺了引號
這里多了分號,if()后面是不需要加分號的
參考代碼