How to replace a html tag in js?

Viewed 22500

I have a string in which there are continous occurances of a font tag

 <font color="blue">DATA ENTRY</font> 

and in some cases like this

 <font class="beat">DATA ENTRY</font> 

I want to replace the 2 tags with

So that it looks like this

     <p>DATA ENTRY</p>

I tried this ,can anyone please suggest me help.Thanks.

 text = text.replace('<font [^"]*>',<p>).replace('</font>','');
6 Answers
Related