HTML设置input框只能输入数字
通过正则,设置input只能输入数字
onkeyup="this.value=this.value.replace(/\D/g,‘‘)"
代码如下
<tr class="b">
<td width="20%">價格</td>
<td>
<input class="input" type="text" onkeyup="this.value=this.value.replace(/\D/g,‘‘)" name="atc_money" value=‘$threads_buy_price‘ $htmlcolor $htmlsell>
</td>
</tr>