实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <title>Execution Context Example 1</title>
5
    <script type="text/javascript">
6
          
7
        var color = "blue";
8
        
9
        function changeColor(){
10
            if (color === "blue"){
11
                color = "red";
12
            } else {
13
                color = "blue";
14
            }
15
        }
16
        
17
        changeColor();
18
19
        alert("Color is now " + color);
20
      
21
    </script>
22
23
</head>
24
<body>
25
  
26
</body>
27
</html>