html页面控制输入框只能输入数字、字母或者下划线,pc和其他手机输入法都有用,但是苹果手机自带的输入法却可以输入汉字
起名真的烦 2017-12-26 04:04:52 如题
下面是代码
<input id='username' class='form-control' style='width:80%;' maxlength='11' required='true' autocomplete='off' placeholder='请输入用户名,只能字母、数字或下划线' onkeyup="value=value.replace(/[\\W]/g,'')" onafterpaste="value=value.replace(/[\\\W]/g,'')" style='width:200px' type='text'>