<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>多个条件判断</title> </head> <body> <!-- score >= 90(奖励50元) 80<= score < 90 (奖励10元) 70<= score < 80 (不挨罚) 60<= score < 70 (父母单打) score < 60 (父母双打) --> <script> var score = prompt("请输入你的成绩"); /*if(score >= 90){ console.log("奖励50元"); }else if(score >= 80 && score < 90){ console.log("奖励10元"); }else if(score >= 70 && score < 80){ console.log("不挨罚"); }else if(score >= 60 && score < 70){ console.log("父母单打"); }else{ console.log("父母双打"); }*/ </script> </body> </html>