input只能输入整数字和小数点

$("input").on("keyup", function (event) {

      console.log($(this).val());
      event.target.value = event.target.value.replace(/[^\d.]/g, "");
    });
posted @ 2022-09-21 22:11  芳香四溢713051  阅读(42)  评论(0编辑  收藏  举报