javascript 关于数字的验证
是否数字:
1
if
(isNaN($(
this
).val()))
2
{
3
alert(it is not a number) ;
4
}
1
是否是正整数:
1
var
value = parseInt($(
this
).val())
2
if
(value < 0 || value != $(
this
).val())
3
{
4
alert(
"it is not Signed Integer"
) ;
5
}