Mam oto taki skrypt w js wszystko działa ładnie tylko co dopisać w formule aby zamieniał wszystkie tagi oprócz "<br />" ?
function removeHTMLTags(){
var strInputCode = '
<b>lalala
</b> xxxxxxxxxxxx
<p> a
</p><br />';
/*
This line is optional, it replaces escaped brackets with real ones,
i.e. < is replaced with < and > is replaced with >
*/
strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
return (p1 == "lt")? "<" : ">";
});
var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
alert("Input code:\n" + strInputCode + "\n\nOutput text:\n" + strTagStrippedText);
}