Blogger Information
Blog 11
fans 0
comment 0
visits 6499
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1.16zuoye
阿力的博客
Original
646 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>1.16</title>
</head>
<body>

    <p onclick="alert('不错100分')">我爱玩js</p>
    <button onclick="dj()">点击</button>
    <button onclick="kaoshi()">考试</button>
</body>
<script>
    function dj(){
        var i=6;
        if(i<5){
            alert('数字太小了')
        }else{
            alert('刚刚好')
        }
    }



</script>
   <script src="static/js/js01.js"></script>
<script>
    function kaoshi(){
        var grade = 100;
// 这里必须传入true,否则内部除了default外,不会执行任何分支
// 这种情形适用于case 条件是一个条件表达式,而不是一个离散的具体值
switch (true) {
    case (grade >= 60 && grade < 80):
        console.log('合格');
        break;
    case (grade >= 80 && grade < 90):
        console.log('良好');
        break;
    case (grade >= 90):
        console.log('优秀');
        break;
    default:
        console.log('补考');
}
    }
    var i = 0;
while (i<10) {
    console.log(i);
    i++;    // 必须要设置循环终止的条件,否则会陷入死循环
}


var cars=["baoma","luhu","benchi"];
for(i=0;i<cars.length;i++)
{
    document.write(cars[i]+"<br>")
}





</script>

<script type="text/javascript">

    var arr = new Array(6)//slice的用法
    arr[0] = "George"
    arr[1] = "John"
    arr[2] = "Thomas"
    arr[3] = "James"
    arr[4] = "Adrew"
    arr[5] = "Martin"
    
    document.write(arr + "<br />")
    document.write(arr.slice(2,4) + "<br />")
    document.write(arr)
    
    </script>



<script>





</script>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

Correction status:qualified

Teacher's comments:作业的标题不符合、缺少总结,群文件中有作业的要求请详细阅读一下
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post