Replace more than one instance on a character with javascript
<p>I tried:</p>

<pre><code>var test = code.replace("-", "%2D");
</code></pre>

<p>but if code = "1-2-3", it only replaces one dash. How do I replace both?</p>
