标签:replace get his console 字符串 长度 return ret input
$("input").keyup(function(){
name_length=getLength($(this).val());
console.log(name_length)
})
function getLength(str){
return str.replace(/[^\x00-xff]/g,"xx").length;
}
标签:replace get his console 字符串 长度 return ret input
原文地址:http://www.cnblogs.com/gaogan/p/6827884.html