输入框使用
图
输入框使用

限制只能输入数字和长度

onkeypress="return( /[\d]/.test(String.fromCharCode(event.keyCode)))" maxlength="10"