var str = '<!-- 注释1 --><h1 style="color:#00ff00;text-align: center;">ProsperLee<!-- 注释 --></h1>';
        document.write(str.replace(/<!--[\w\W\r\n]*?-->/gmi, '')); // 去除HTML中的注释
        document.write(str.replace(/<[^>]+>/g,"")); // 去除HTML标签
        document.write(str.replace(/(<[^\s\/>]+)\b[^>]*>/gi,"$1>")); // 去除HTML标签中的属性

相关文章:

  • 2021-12-20
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案