·  JavaScript – Syntax – Conditional Statements – if...else

 

- Info:

  - This tutorial shows how to use if...else conditional statements.

 

- Example:

  - Create D\Temp\JavaScript\Test.html

 

    Test.html

    <script type="text/javascript" language="javascript">

      

      value = 10;

      text  = "bird";

      

      if      (value == 10    ) { window.alert("Value = 10"      ); }

      else if (text  == "bird") { window.alert("text equals bird"); }

      else                      { window.alert("No match found"  ); }

   

    </script>