<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;
}
});
时间: 2024-09-30 19:08:59