Compare value in if statement - Javascript Statement

Javascript examples for Statement:if

Description

Compare value in if statement

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){//from w w  w.  j  a  va 2  s . co m
   var p = 100;
   if(100 > p >= 10){
      console.log("0." + p);
   }
   else if(p < 10){
      console.log("0."+ "0" + p);
   }
   else{
      console.log(1);
   }
}

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials