jQuery.isNumeric in jQuery 1.7
This function is really useful as it also returns true for negative numbers, decimal numbers, octal integer, Hex numbers and exponential strings. It saves lots of line of your codes and you don't have to worry about the regular expression as well to validate the number.
$.isNumeric("-10"); // true $.isNumeric(16); // true $.isNumeric(0xFF); // true $.isNumeric("0xFF"); // true $.isNumeric("8e5"); // true (exponential notation string) $.isNumeric(3.1415); // true $.isNumeric(+10); // true $.isNumeric(0144); // true (octal integer literal) $.isNumeric(""); // false $.isNumeric({}); // false (empty object) $.isNumeric(NaN); // false $.isNumeric(null); // false $.isNumeric(true); // false $.isNumeric(undefined); // false
Feel free to contact me for any help related to jQuery, I will gladly help you.