【发布时间】:2014-11-05 11:43:18
【问题描述】:
测试字符串是否为整数的函数是什么:
jQuery.isNumeric()
我想测试一个输入的 html 元素:
<input id='distance' type='text' />
提前谢谢你
【问题讨论】:
-
就是这个功能。你还需要知道什么?
-
@Dan 这不是重复的。这个问题是关于决定它是 int 还是 float。这个问题只是想知道它是否是任何一种数字。
-
好吧,这似乎已经有很多问题了 - 这是另一个类似的问题:stackoverflow.com/questions/600763/… 和另一个 stackoverflow.com/questions/1272696/…
-
函数 isNumeric() 的情况是:api.jquery.com/jquery.isnumeric 但我问我如何测试它是否为整数
标签: jquery html testing text input