isFinite()
JavaScript 1.3+, ECMAScript 1.0+, JScript 3.0+ Nav4.06+, IE 4+, Opera3+ Syntax
isFinite()
Description
The isFinite() method is used to determine if a variable has finite bounds.
Example
In Listing 6.147, isFinite() method is used to verify if the user input value has finite bounds.
Listing 6.147 Example of isFinite() Method
<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 ... |
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.