-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11(if判断).html
45 lines (45 loc) · 1.06 KB
/
11(if判断).html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>这是鱼爸爸的网址</title>
<script type="text/javascript">
// var age = prompt("请输入年龄:");
// if (age<=18) {
// document.write("小孩");
// } else if(age<=35){
// document.write("年轻人");
// } else if(age<=65){
// document.write("中年人");
// } else if(age<=100){
// document.write("老年人");
// } else{
// document.write("未知");
// }
var age = prompt("请输入你的年龄");
if (age<=10) {
document.write("儿童");
} else if(age<=20){
document.write("弱冠");
} else if(age<=30){
document.write("而立");
} else if(age<=40){
document.write("不惑");
} else if(age<=50){
document.write("知天命");
} else if(age<=60){
document.write("花甲");
} else if(age<=70){
document.write("古稀");
} else if(age<=80){
document.write("耄耋");
} else if(age<=90){
document.write("人仙");
} else{
document.write("入土为安");
}
</script>
</head>
<body>
</body>
</html>