文本框只能输入数字

只允许输入数字(不带小数点的)
<input type="text" onkeyup="value=value.replace(/[^\d]/g,'')" name="numSort">


只允许输入数字(带小数点的)
<input type="text" onkeyup="value=value.replace(/[^\d\.]/g,'')" name="numSort">

猜你喜欢

转载自wentao365.iteye.com/blog/1807778
今日推荐