input框验证非数字不能输入

2019-01-06  本文已影响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="请输入奖品编号">
上一篇 下一篇

猜你喜欢

热点阅读