為什么彈不出窗口?求解
<!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)
{
? 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>
我的代碼通過了,但是窗口彈不出為什么?各位大神,麻煩了。
2015-12-07
兩個錯誤 為輸入成績后面的分號 ? onClick ?應該為onclick
2015-12-15
未輸入成績后面的那個分號是中文狀態下的,改了應該可以
2015-12-08
你的api寫錯了