js 将html转为纯文本
作者:互联网
var html = "<label for="content" class="el-form-item__label" style="width: 80px;">消息内容</label>"
var text = html.replace(/<(style|script|iframe)[^>]*?>[\s\S]+?<\/\1\s*>/gi,'').replace(/<[^>]+?>/g,'').replace(/\s+/g,' ').replace(/ /g,' ').replace(/>/g,' ')
标签:text,js,replace,html,var,文本,gi 来源: https://www.cnblogs.com/ljmin9527/p/14980172.html