📅  最后修改于: 2022-03-11 15:03:44.180000             🧑  作者: Mango
$('#MyTextInput').on('propertychange input', function () {
let result = $(this).val().replace(/[^\d]+/g, '');
$(this).val(result);
});