标签:
<input type="text" class="chujia" onkeyup="this.value=this.value.replace(/\D/g,‘‘)" onafterpaste="this.value=this.value.replace(/\D/g,‘‘)">
var upVal, downVal;
var filter = /^[0-9]*$/;
$(document).on(‘input propertychange‘, ‘.chujia‘, function () {
downVal = $(this).val();
if (!filter.test(downVal)) {
return false;
}
});
标签:
原文地址:http://www.cnblogs.com/rukialu/p/4287867.html