Why does javascript replace only first instance when using replace?
<p>I have this</p>

<pre><code> var date = $('#Date').val();
</code></pre>

<p>this get the value in the textbox what would look like this</p>

<p>12/31/2009</p>

<p>Now I do this on it</p>

<pre><code>var id = 'c_' + date.replace("/", '');
</code></pre>

<p>and the result is </p>

<p>c_1231/2009</p>

<p>It misses the last '/' I don't understand why though.</p>
