<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
var num = prompt("请输入一个0-100之间的整数,会有惊喜!");
for(var i = 1;i<=num;i++){
if(num>=20 && num<=30){
document.write("触发陷阱!游戏结束!");
break;
}
document.write(i+"你好啊!<br>");
}
</script>
</head>
<body>
</body>
</html> |
|