国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

if conditional judgment statement in JavaScript

if conditional judgment statement:

#If the condition is true, what code will be executed; if the condition is not true, what code will be executed


Structure 1: Only judge true (true), if the condition is false, do nothing

if (Conditional judgment: the judgment result is a Boolean value)

{

The condition is true (true), the executed code

}


## Structure 2: Both true and false

if (Conditional judgment)

{

If the condition is true, the code to be executed

}else

{

The condition is false, the code to be executed Code

}


# Structure 3: Multi-condition judgment
if(Condition 1)

{

Code 1;

}else if(Condition 2)

{

Code 2;

}else if(condition 3)

{

Code 3;

}else

{

If none of the above conditions are true, execute this code;

}

Note: Although there are multiple conditions, there is an "OR" relationship between the conditions. . At any moment, only one condition can be true, and multiple conditions cannot be met at the same time.

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>php.cn</title>
        <script>
        //給一個(gè)成績
        var score=89;
        //判斷成績所屬級別
        if(score<60){
            document.write("對不起,沒有及格");
        }else if (score>=60&&score<70){
            document.write("剛好及格");
        }else if(score>=70&&score<80){
            document.write("成績良好");
        }else if(score>=80&&score<90){
            document.write("成績優(yōu)秀");
        }else if(score>=90&&score<100){
            document.write("試卷這么難,這樣的成績簡直逆天");
        }else{
            document.write("對不起,你的成績超出系統(tǒng)判斷范圍,請重新輸入");
        }
        
        </script>
    </head>
    <body>
    </body>
</html>

Continuing Learning
||
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <script> //給一個(gè)成績 var score=89; //判斷成績所屬級別 if(score<60){ document.write("對不起,沒有及格"); }else if (score>=60&&score<70){ document.write("剛好及格"); }else if(score>=70&&score<80){ document.write("成績良好"); }else if(score>=80&&score<90){ document.write("成績優(yōu)秀"); }else if(score>=90&&score<100){ document.write("試卷這么難,這樣的成績簡直逆天"); }else{ document.write("對不起,你的成績超出系統(tǒng)判斷范圍,請重新輸入"); } </script> </head> <body> </body> </html>
submitReset Code