let htmlStr = <p>12322</p>
let value = htmlStr.replace(/<[^>]+>/g, '')
console.log(value) //12322
console.log(value.length) //5
过滤富文本
最新推荐文章于 2023-08-01 16:08:25 发布
let htmlStr = <p>12322</p>
let value = htmlStr.replace(/<[^>]+>/g, '')
console.log(value) //12322
console.log(value.length) //5