javascript - remove all <br> from a string -


i have string remove occurrences of <br>

i tried , did not work.

    productname = productname.replace("<br>"," "); 

however worked first <br>

    productname = productname.replace("&lt;br&gt;"," "); 

how work <br> in string.

edit: string...

00-6189 start mech switch&lt;br&gt;00-6189 start mech switch&lt;br&gt;00-6189 start mech switch&lt;br&gt;

my apologies being little misleading <br> should have been &lt;br&gt;

looks string encoded use

productname = productname.replace(/&lt;br&gt;/g," "); 

note g after regular expression means globally, match occurrences.

demo @ http://www.jsfiddle.net/gaby/vdxhx/


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -