<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>prompt</title> <script type="text/javascript"> function rec(){ var sorce; sorce=prompt("请输入你的成绩"); if (sorce>=140) {document.write("非常棒!");} if else(sorce>=120) {document.write("很好");} if else(sorce>=90) {document.write("加油哦");} else {document.write("要努力了啊");} } </script> </head> <body> <input name="button" name="button" onClick="rec()" value="点击我,对成绩做评价!" /> </body> </html>
dommon