控制input只能輸入數字和兩位小數
<input type="text" name="je" onkeyup="clearNoNum(this)" /> function clearNoNum(obj){ obj.value = obj.value.replace(/[^\d.]/g,""); //清除"數字 ...
<input type="text" name="je" onkeyup="clearNoNum(this)" /> function clearNoNum(obj){ obj.value = obj.value.replace(/[^\d.]/g,""); //清除"數字 ...
js: html: <!--限制文本框只能輸入正數、小數、負數--> 附:https://funteas.com/topic/592f828e572bfb9c4d965ab0(關於正則的一些表達式) ...
jquery代碼 限制只能保留兩位小數點 限制只能輸入數字 限制只能輸入數字、字母和"-" ...
<input class="input_text" type="text" placeholder="請輸入上限" maxlength="4" onkeyup="this.value=this.value.replace(/[^\d\.\d{0,2}]/g ...
//input輸入框只能輸入數字和 小數點后兩位 function num(obj,val){ obj.value = obj.value.replace(/[^\d.]/g,""); //清除"數字"和"."以外的字符 obj.value = obj.value.replace ...
,""); //清除“數字”和“.”以外的字符 obj.value = obj.value.replace ...