使用如下方法 if("中文比较".charCodeAt() == "中文比较".charCodeAt()) //true if("中文比较".charCodeAt() == "英文比较".charCodeAt()) //false