input只能输入数字

来源:互联网 发布:网络大电影剧本价格 编辑:程序博客网 时间:2024/05/16 10:50

转自:http://zhidao.baidu.com/question/183104819.html

<input type="text"  id="number" name="number" onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" placeholder="只能输入数字"/>


0 0