input type=text限制只能输入数值

<input type='text' onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" />

猜你喜欢

转载自www.cnblogs.com/yugb/p/9574005.html