On May 30, 1:43 pm, mbloc...@yahoo.com wrote:
Does anyone has a function that will remove all HTML tags in some
string?
like
function removeFormating(str)
In general, this should work:
var myString = '<b>some</b<a href="foo.html">text</a>';
myString = myString.replace(/<[^>]*>/g, '');
alert(myString); //result is 'some text'
so you want something like this:
function removeFormatting(str) {
return str.replace(/<[^>]*>/g, '');
}