强制输入中文<input type="text" id="username" name="username" οnkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" tabindex="2" /><br>
强制输入数字<input type="text" name="qq" onKeyPress="if(event.keyCode<48 || event.keyCode>57)event.returnValue=false"/>
<br>
修改后提示<input type="text" οnchange="if((/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(this.value)){return true}else{alert('提示消息')}"/>
强制输入数字<input type="text" name="qq" onKeyPress="if(event.keyCode<48 || event.keyCode>57)event.returnValue=false"/>
<br>
修改后提示<input type="text" οnchange="if((/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(this.value)){return true}else{alert('提示消息')}"/>