Mam oto taki skrypt w js wszystko działa ładnie tylko co dopisać w formule aby zamieniał wszystkie tagi oprócz "<br />" ?

  1. function removeHTMLTags(){
  2. var strInputCode = '<b>lalala</b> xxxxxxxxxxxx <p> a </p><br />';
  3. /*
  4. This line is optional, it replaces escaped brackets with real ones,
  5. i.e. &lt; is replaced with < and &gt; is replaced with >
  6. */
  7. strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
  8. return (p1 == "lt")? "<" : ">";
  9. });
  10. var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
  11. alert("Input code:\n" + strInputCode + "\n\nOutput text:\n" + strTagStrippedText);
  12.  
  13. }