通過正則,設置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>