I have a string that i would like to remove all occurrences of <br>
I tried this and it did not work.
productName = productName.replace("<br>"," ");
However this worked but only for the first <br>
productName = productName.replace("<br>"," ");
How would I get it to work for all <br> in the string.
Edit: this is the string…
00-6189 Start Mech Switch<br>00-6189 Start Mech Switch<br>00-6189 Start Mech Switch<br>
My apologies for being a little misleading with the <br> as it should have been <br>
Looks like your string is encoded so use
note the
gafter the regular expression which means globally, to match all occurrences.demo at http://www.jsfiddle.net/gaby/VDxHx/