美文网首页
input框验证非数字不能输入

input框验证非数字不能输入

作者: 滔滔逐浪 | 来源:发表于2019-01-06 17:36 被阅读3次
<tr>
    <td>单次消耗积分</td>
    <td colspan="2"><input type="text" name="score" id="score" value="" onkeyup="value=value.replace(/[^\d]/g,'') " onbeforepaste="clipboardData.setData
('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/>

输入框夹带提示的文字
<input type="text" class="input-text" id="code" name="code" placeholder="请输入奖品编号">

相关文章

网友评论

      本文标题:input框验证非数字不能输入

      本文链接:https://www.haomeiwen.com/subject/oogsrqtx.html