<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
var score = prompt("请输入小明的成绩(0-100):");
if(score==100){
alert('恭喜你获得宝马');
}
else if(score>=80 && score<=99){
alert('恭喜你获得一台iphone15s');
}
else if(score>=60 && score<80){
alert("获得一本参考书,继续努力");
}
else if(score>=0 && score<60){
alert('继续努力');
}
else{
alert('输入错误!!!')
}
</script>
</head>
<body>
</body>
</html>
效果如下: