实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
4
<body>
5
<script type="text/vbscript">
6
d=weekday(Date)
7
8
Select Case d
9
  Case 1
10
    document.write("Sleepy Sunday")
11
  Case 2
12
    document.write("Monday again!")
13
  Case 3
14
    document.write("Just Tuesday!")
15
  Case 4
16
    document.write("Wednesday!")
17
  Case 5
18
    document.write("Thursday...")
19
  Case 6
20
    document.write("Finally Friday!")
21
  Case Else
22
    document.write("Super Saturday!!!!")
23
End Select
24
</script>
25
26
<p>This example demonstrates the "Select Case" statement.</p>
27
<p>You will receive a different greeting based on what day it is.</p>
28
<p>Note that Sunday=1, Monday=2, Tuesday=3, etc.</p>
29
30
</body>
31
</html>