<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>prompt</title>
<script language="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
{
document.write("要努力了!");
}
}
</script>
</head>
<body>
<form>
<input name="button" type="button" onClick="rec()" value="點擊我,對成績做評價!">
</form>
</body>
</html>

夏_Ng
2014-08-13
1 回答
舉報
0/150
提交
取消
2014-08-14
把第9行后面多余的分號去掉