<input type="text" class="chujia" οnkeyup="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;
}
});