js 正则替换html标签

function deleteTag(str)
{
  var regx = /<[^>]*>|</[^>]*>/gm;
  if(str) return str.replace(regx,"");
return ''; } deleteTag('<p>小五老师:</p><p>  其他应收款主要包括:</p><p> (1)应收的各种… 选项C,计入应收账款。</p><p> 综上,本题应选C。<br></p>')
原文地址:https://www.cnblogs.com/xuan52rock/p/14006706.html