三行代码搞定input框number类型输入E字母问题

$('input[type=number]').keypress(function (e) {
    if (!String.fromCharCode(e.keyCode).match(/[0-9\.]/)) return false;
});

对你有帮助的话,右上角给个赞呗~

发布了61 篇原创文章 · 获赞 90 · 访问量 14万+

猜你喜欢

转载自blog.csdn.net/wkh___/article/details/103801905