<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>分支结构</title>
<script>
<!--if语句-->
var age=window.prompt("请输入你的年龄")
if (age<0 || age>150){
document.write("输入无效");
// return;
}
else {
if (age<30){
document.write("年轻人");
}
else if (age<60){
document.write("中年人");
}
else {
document.write("老年人");
}
}
//for语句
for (var i=0;i<100;i++){
document.write("欢迎"+i+"<br/>");
}
</script>
</head>
<body>
</body>
</html>