Global.Infinity : Infinity : Global JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Global » Infinity »

 

Global.Infinity







Infinity is a JavaScript keyword that represents positive infinity.












<html>
    <body>
    <script language = "JavaScript">
    <!--
    function checkNum(){
       input=document.form1.num.value;
       if(input < Infinity){
           alert("Your number is less than Infinity");
       }
       else if(input > Infinity){
          alert("Your number is greater than Infinity");
       }else if(input == Infinity){
         alert("Your number if equal to Infinity");
       }else{
         alert("do not know how to compare");
       }
    }
    -->
    </script>
    <form name="form1">
    Enter a number to compare against Infinity.
    <br><br>
    <input type="text" size="35" name="num">
    <br><br>
    <input type="button" value="Check Number" onClick='checkNum()'>
    </form>
    </script>
    </body>
    </html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Global
» Infinity