富文本编辑标签导致计算字数不匹配

富文本编辑中获取的 length 包括 富文本的标签
处理方式:
用正则去掉了所带标签
/** * remove the tag of html * @param str */ function removeTAG(str){ return str.replace(/<[^>]+>/g, ""); }

富文本编辑中获取的 length 包括 富文本的标签
处理方式:
用正则去掉了所带标签
/** * remove the tag of html * @param str */ function removeTAG(str){ return str.replace(/<[^>]+>/g, ""); }