JS只能输入正整数的简单实例
如下所示: <html> <head> <title>只能输入正整数</title> </head> <body> 兑换数量:<input type="text" ID="txtNumber" Width="50px" onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafter
下载地址
用户评论