js判断中文字符长度

 就是 你把

String.prototype.len = function() 

return this.replace(/[^x00-xff]/g, "xx").length; 

放到你的 <Script></script>当中去,
然后你要判断长度的那里 就这么用

alert($("#文本框id").val().len()); 

就行了

原文地址:https://www.cnblogs.com/jassy/p/6747825.html