实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <title>Switch Statement Example 3</title>
5
    <script type="text/javascript">
6
        switch ("hello world") {
7
            case "hello" + " world": 
8
                alert("Greeting was found.");
9
                break;
10
            case "goodbye": 
11
                alert("Closing was found.");
12
                break;
13
            default: 
14
                alert("Unexpected message was found.");
15
        }
16
17
    </script>
18
</head>
19
<body>
20
21
</body>
22
</html>