1、输入框只准输入中文 var a = '1234 aq ~ -+asdf 你好 00 啊'; console.log(a.replace(/[^\u4E00-\u9FA5]/g,'')); 这篇文章不错:http://www.jb51.net/article/80544.htm