Skip to main content
Source Link
Sean the Bean
  • 5.4k
  • 5
  • 39
  • 40

I realize the original question did not mention jQuery, but if you do use jQuery, you can do:

$.isNumeric(val)

Simple.

https://api.jquery.com/jQuery.isNumeric/ (as of jQuery 1.7)

Post Made Community Wiki by Sean the Bean