August 1999
Intermediate to advanced
1488 pages
72h 53m
English
isFinite()
The isFinite() method is used to determine if a variable has finite bounds.
In Listing 6.147, isFinite() method is used to verify if the user input value has finite bounds.
<html> <body> <script lanuguage="JavaScript"> <!–– Hide function checkNum(){ var n = document.form1.text1.value; if(isFinite(n) == true){ alert("Your entry had finite bounds"); } } // End Hide –– > </script> <form name="form1"> Enter a number or character into the text box and the click the check value button to verify if the input is a number. <br><br> <input type="text" name="text1" size=3> <br><br> <input ... |
Read now
Unlock full access