JQuery IsNumeric with missing condition

I use jQuery to check if something isNumeric. How to check if it is numerical?

if (IsNumeric($('#Amount').val())) { ..... 

I put! to IsNumeric, but that didn't work.

+4
source share
1 answer

Your function call is a bit off. It should be jQuery.isNumeric() or $.isNumeric() , so your code will look like this:

 if(!$.isNumeric($('#Amount').val())) { // do something } 
+12
source

Source: https://habr.com/ru/post/1388370/


All Articles