标签:maxlength data max get 个数 pre clip ace cli
test
<input onkeyup="this.value=this.value.replace(/\D/g,‘‘)" onafterpaste="this.value=this.value.replace(/\D/g,‘‘)" maxlength="11"/>
<input onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,‘‘)" onbeforepaste="clipboardData.setData(‘text‘,clipboardData.getData(‘text‘).replace(/[^\u4E00-\u9FA5]/g,‘‘))" maxlength="10">
<input onkeyup="value=value.replace(/[\W]/g,‘‘) " onbeforepaste="clipboardData.setData(‘text‘,clipboardData.getData(‘text‘).replace(/[^\d]/g,‘‘))" maxlength="10">
<input type="text" onkeyup="this.value=this.value.replace(/[^a-zA-Z]/g,‘‘)" maxlength="10">
<input onkeyup="value=value.replace(/[^\d{1,}\.\d{1,}|\d{1,}]/g,‘‘)" />
<input onkeyup="value=value.replace(/[^\w&=]|_/ig,‘‘)" onblur="value=value.replace(/[^\w&-]|_/ig,‘‘)" />
标签:maxlength data max get 个数 pre clip ace cli
原文地址:https://www.cnblogs.com/zjx304/p/10027186.html