猜数字制作
<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title></head><body><script>function fun() {alert("1-100猜数字");let num = Math.floor(Math.random() * 100) + 1;for (let i = 1; i <= 10; i++) {let numb = prompt("请输入:");if (i == 10) {alert("正确的数是:" + num);} else if (i < 10) {if (numb == num) {alert("对了");break;} else if (numb > num) {alert("大了");} else if (numb < num) {alert("小了");}}}}fun();</script></body>
</html>