remove text from string array with javascript/jquery
<p>Using <code>.each()</code> to go through an array, and trying to use <code>replace()</code> to find all the "<code>&lt;br&gt;</code>" and replace with " " (pretty simple) but nothing happens - no errors, it just doesn't replace.</p>

<pre><code>//get values of each td in row
var values = '';
var tds = $(this).find('td');

$.each(tds, function(index, tditem) {
    values = values + "td" + ':' + tditem.innerHTML + '\n';
    values = values.replace(/&lt;br&gt;/i, " ");
});
</code></pre>

<p>Acknowledging that it would be better to manipulate a DOM element (and selecting one of those answers as the correct answer) I ended up adding this to my function as it just makes my life easier in the short-term:</p>

<pre><code>values = values.replace(/&lt;br&gt;/i, " ");
</code></pre>

<p>Thanks @all</p>
