x
1
<html>
2
<head>
3
<meta charset="utf-8">
4
<title>蜜蜂教程(mifengjc.com)</title>
5
</head>
6
<body>
7
8
<script type="text/javascript">
9
var d = new Date();
10
var time = d.getHours();
11
if (time < 10) {
12
document.write("<b>早上好</b>");
13
} else if (time >= 10 & time 今天好");
14
} else {
15
document.write("<b>晚上好!</b>");
16
}
17
</script>
18
<p>
19
这个例子演示了 if..else if...else 语句。
20
</p>
21
22
</body>
23
</html>