我只想在输入字段中使用数字。如何让手机键盘这样的屏幕https://drive.google.com/drive/folders/0B0eU9chNlIdabU1VTWQycy1mb3M?usp=sharing如何仅允许手机键盘上的数字
INPUTMODE = “数字” 不工作:(
$('.input-number').on('input', function (event) {
this.value = this.value.replace(/[^0-9]/g, '');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input class="input-number" type="text" maxlength="5" inputmode="numeric">
类型= “数字” 做工作 –