js input只能输入数字

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

猜你喜欢

转载自blog.csdn.net/Feast_aw/article/details/80735416