jQuery.isNumeric()
methodYou can use the jQuery $.isNumeric()
method to check whether a value is numeric or a number.
The $.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, otherwise it returns false
.
Let's take a look at the following example to understand how it basically works:
<script>
// Return true (numeric)
$.isNumeric("-10")
$.isNumeric("0")
$.isNumeric(0xFF) /* Hexadecimal notation (0xFF represents the number 255) */
$.isNumeric("0xFF")
$.isNumeric(+10)
$.isNumeric(1.25e2) /* Exponential notation (1.25e2 represents the number 125) */
$.isNumeric("1.25e2")
$.isNumeric("13.417")
$.isNumeric(0144)
$.isNumeric(-0x56)
// Return false (non-numeric)
$.isNumeric("-0x52")
$.isNumeric("7.2xyz")
$.isNumeric("")
$.isNumeric({})
$.isNumeric(NaN)
$.isNumeric(null)
$.isNumeric(true)
$.isNumeric(Infinity)
$.isNumeric(undefined)
</script>
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to get drop-down Select Values in React
React-Select is profoundly easy to...PHP 7 - Upload Files & Images with Example Tutorials
This is a step by step PHP 7 file upload...How to get Last Record From leftJoin Table in Laravel7?
In this article i will share with you on...Laravel 8 - How to send Bulk Mail in Background using Queue
In this article, i will share with you h...jQuery val method
In this article, we will learn how you c...