jQuery.isNumeric( value )Returns: Booleanversion deprecated: 3.3
Description: Determines whether its argument represents a JavaScript number.
-
version added: 1.7jQuery.isNumeric( value )
-
valueType: AnythingThe value to be tested.
-
Note: This API has been deprecated in jQuery 3.3.
The $.isNumeric()
method checks whether its argument represents a numeric value. If so, it returns true
. Otherwise it returns false
. The argument can be of any type.
As of jQuery 3.0 $.isNumeric()
returns true
only if the argument is of type number
, or if it's of type string
and it can be coerced into finite numbers. In all other cases, it returns false
.
Example:
Sample return values of $.isNumeric with various inputs.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
|