猜数字_游戏娱乐特效

模板酷站
  •       3/5
  •       1
  •       2
  •       3
  •       4
  •       5
查看演示效果

      织梦DedeCMS视频教程买空间 租服务器 选网硕互联! 无忧站长工具,百度权重一键全查!

      猜数字,您可以先修改部分代码再运行.

      <html> <head> <title>Guess a Number-模板无忧www.mb5u.com</title> <script LANGUAGE="JavaScript"> var num = Math.floor(Math.random() * 100) + 1; var tries = 0; function guessit() { var guess = document.form1.guess1.value; tries++; status = "Tries: " + tries; if (guess < num) document.form1.hint.value = "不对, 猜高点."; if (guess > num) document.form1.hint.value = "不对, 猜低点."; if (guess == num) { window.alert("正确! 恭喜你只用了" + tries + " 次."); location.reload(); } if (tries == 10) { window.alert("对不起,时间到. 答案是: " + num); location.reload(); } } </script> </head> <body BGCOLOR=336699> <h1><CENTER><FONT SIZE=15 COLOR=RED >猜数字</FONT></CENTER></h1> <hr> <p><CENTER><FONT SIZE=5 COLOR=BLUE >这个数在100以内. 你只有10次机会.</FONT></CENTER></p> <form NAME="form1"> <input TYPE="text" SIZE=25 NAME="hint" VALUE="填入你的数字."> <br> <b>猜吧:</b> <input TYPE="text" NAME="guess1" SIZE="5"> <input TYPE="BUTTON" VALUE="确定" onClick="guessit();"> <input TYPE="BUTTON" VALUE="确定" onClick="ss();"> </form> </body> </html>