HTML 只能输入数字

 

 

<input id="year3" class="wid50" onkeyup="    if (this.value.length == 1) { this.value = this.value.replace(/[^1-9]/g, '') } else { this.value = this.value.replace(/\D/g, '') }" type="text" />

posted @ 2016-08-31 16:23  人生为卒  阅读(240)  评论(0编辑  收藏  举报