js正则过滤字母
<input type="text" id="txt" /> <input type="button" onclick="check()" value="检测输入"/> <script> function check(){ var reg=/[A-Za-z]/g; var input=document.getElementById("txt").value; var result=input.replace(reg,""); alert(result); } </script>
<script language="JavaScript" type="text/javascript"> var a='asdfas123^dfa123' alert(a.replace(/[a-z]/gi,"")) </script>