我必须创建一个程序,您可以在其中输入数字1-100,并输出与您的分数相对应的字母等级,并且无法显示提示。以下是一些代码:HTML提示()将不会显示
function myGrade() {
var Input = prompt("Input grade here:");
if (Input >= 90) {
document.write("The score you entered is "
Input ". Your letter grade is A.");
} else if (Input >= 80 && Input < 90) {
document.write("The score you entered is "
Input ". Your letter grade is B.");
} else if (Input >= 70 && Input < 80) {
document.write("The score you entered is "
Input ". Your letter grade is C.");
} else if (Input >= 60 && Input < 70) {
document.write("The score you entered is "
Input ". Your letter grade is D.");
} else if (Input < 60) {
document.write("The score you entered is "
Input ". Your letter grade is F.");
}
}
我在这段代码上面使用了<body onload = "myGrade()">
。
你在控制台上看到了什么错误? – 2015-10-17 05:39:45