- html代码:
<input class="form-control type="text" placeholder="0" οnkeyup="onlyNum(this)" />
- js代码
//判断只能输入数字,非数字替换为kon
obj.value = obj.value.replace(/\D/g,"");
}
转载至:https://blog.csdn.net/mathilda001/article/details/76031917
<input class="form-control type="text" placeholder="0" οnkeyup="onlyNum(this)" />
//判断只能输入数字,非数字替换为kon
}
转载至:https://blog.csdn.net/mathilda001/article/details/76031917