This function helps to check whether a variable's value is numeric or not.
var isNumeric = function(x) {
// returns true if x is numeric and false if it is not.
var RegExp = /^(-)?(\d*)(\.?)(\d*)$/;
return String(x).match(RegExp);
}
Hope this helps!
No comments:
Post a Comment