<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>prompt</title> <script> function rec() { var score; score =prompt("请输入你的成绩,1-100数值之间"); if(score>90){ document.write("好棒啊"); } else if(score>=75){ document.write("不错哦"); } else if(score>=60){ document.write("及格了"); } else if(score<60&&score>=0){ document.write("加油吧"); } else{ document.write("请输入正确数值"); } } </script></head><body><input type="button" name="button" onClick="rec()" value="点击我,对成绩做评价"></body></html>
时间: 2024-10-14 07:14:34