what is the function which test if a string is an Integer or not like the method :
jQuery.isNumeric()
i want to test an input html element :
<input id='distance' type='text' />
thank you in advance
what is the function which test if a string is an Integer or not like the method :
jQuery.isNumeric()
i want to test an input html element :
<input id='distance' type='text' />
thank you in advance
thank you for your contributions i found the answer :
if(Math.floor($('#distance').val()) == $('#distance').val() && $.isNumeric($('#distance').val()))
{
alert('yes its an int!');
}
I use this
function IsInteger(n){
return Number(n) === n && n % 1 === 0;
}
sorry I didn't notice integer when I answered, here is another type check:
if($.type($(#distance).val())==="number")
please see: http://api.jquery.com/jquery.type/