首页 > 技术文章 > input 中设置只能是数字

riyueqian 2019-09-20 19:44 原文

<input onkeyup="this.value=this.value.replace(/[^0-9-]+.[^0-9-]+/,'');" id="wholesalePrice"  type="text"/>

推荐阅读