标签:
var oInput = document.querySelector("input");
oInput.onkeyup = function () {
var value = this.value;
if(value.search(/^\d+$/) != 0){
this.value = value.replace(/[^0-9]/g,‘‘);
}
}
标签:
原文地址:http://www.cnblogs.com/toward-the-sun/p/4781079.html