Javascript replace regex all html tags except p,a and img

Viewed 6420

I'm trying to remove all html tags except p, a and img tags. Right now I have:

content.replace(/(<([^>]+)>)/ig,""); 

But this removes all HTML tags.

This are examples of the content of the api:

    <table id="content_LETTER.BLOCK9" border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#F7EBF5">
<tbody><tr><td class="ArticlePadding" colspan="1" rowspan="1" align="left" valign="top"><div>what is the opposite of...[] rest of text
2 Answers
Related